Skip to content

Instantly share code, notes, and snippets.

Does nginx support the Retry-After header with a 503 error.
Specifically, I want nginx to try connecting to the upstream after the time specified
in the Retry-After header instead of its default time.
app$ irb
/usr/bin/irb
>> require "extlib"
=> true
>> require "merb-core"
=> true
>> Merb::Plugins.config[:merb_helpers]
=> {}
Screw.Mock = {
confirmWith: function(val) {
Screw.Mock.confirmText = null;
iframeWindow.confirm = function(str) {
Screw.Mock.confirmText = str;
return val;
};
}
};
Screw.XHR = function() {};
(function($) {
$.parseXml = function( xml ) {
if( window.ActiveXObject && window.GetObject ) {
var dom = new ActiveXObject( 'Microsoft.XMLDOM' );
dom.loadXML( xml );
return $(dom);
}
if( window.DOMParser )
return $(new DOMParser().parseFromString( xml, 'text/xml' ));
def start_transaction
Merb.logger.warn! "Parent pid: #{Process.pid}"
reader, writer = nil, nil
loop do
reader, writer = IO.pipe
pid = Kernel.fork
# pid means we're in the parent; only stay in the loop in that case
break unless pid
- foo do
Hello
Goodbye
would get compiled into:
_tmp = ""
@output << foo do
_tmp << "Hello"
_tmp << "Goodbye"
require 'mongrel'
require 'merb-core/rack/handler/mongrel'
module Merb
module Rack
class Mongrel < Merb::Rack::ForkingAdapter
def self.stop
@server.stop(true)
~ Started request handling: Thu Sep 25 11:37:46 -0700 2008
~ Params: {"action"=>"fiveohthree", "controller"=>"bench"}
~ {:before_filters_time=>2.7e-05, :dispatch_time=>0.004589, :after_filters_time=>1.6e-05, :action_time=>0.001009}
~
~ localhost - - [25/Sep/2008:11:37:46 PDT] "GET /bench/string HTTP/1.1" 200 17
~ - -> /bench/string
~ localhost - - [25/Sep/2008:11:37:46 PDT] "GET /favicon.ico HTTP/1.1" 404 14
~ http://localhost:4000/bench/string -> /favicon.ico
$.fn.autocomplete = function(opts) {
opts.list = opts.list || function(arr) {
ret = "<ul class='complete'><li>";
ret += arr.join("</li><li>");
return ret + "</li></ul>";
};
opts.match = opts.match || function(element, typed) {
return element.match(new RegExp(typed, "i"));
};
merb: worker (port 4001) ~ Starting Mongrel at port 4001
merb: worker (port 4001) ~ Successfully bound to port 4001
merb: worker (port 4000) ~ Starting Mongrel at port 4000
merb: worker (port 4000) ~ Successfully bound to port 4000
merb: worker (port 4002) ~ Starting Mongrel at port 4002
merb: worker (port 4002) ~ Successfully bound to port 4002
merb: worker (port 4003) ~ Starting Mongrel at port 4003
merb: worker (port 4003) ~ Successfully bound to port 4003
merb: worker (port 4000) ~ Exiting port 4000
merb: worker (port 4000) ~ Starting Mongrel at port 4000