Skip to content

Instantly share code, notes, and snippets.

@roidrage
Created March 22, 2009 11:06
Show Gist options
  • Save roidrage/83137 to your computer and use it in GitHub Desktop.
Save roidrage/83137 to your computer and use it in GitHub Desktop.
class RunLater::Cleanup
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
ensure
RunLater::Worker.cleanup
end
end
unless Rails.configuration.cache_classes
ActionController::Dispatcher.middleware.push(
ActionController::MiddlewareStack::Middleware.new(
RunLater::Cleanup
)
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment