Changing env back to development mode, the memory leak is likely fixed

This commit is contained in:
Raphael 2010-08-23 16:33:44 -07:00
parent ee7005ad74
commit 74be86395b
2 changed files with 20 additions and 1 deletions

View file

@ -7,7 +7,7 @@ max_conns: 1024
require: []
max_persistent_conns: 512
environment: production
environment: development
servers: 1
daemonize: true
#chdir: /usr/applications/localhash/current

View file

@ -0,0 +1,19 @@
module MongoMapper
class PerRequestMapClear
def initialize(app)
@app = app
end
def call(env)
if Rails.configuration.cache_classes
else
MongoMapper::Document.descendants.each do |m|
m.descendants.clear if m.respond_to? :descendants
end
MongoMapper::Document.descendants.clear
MongoMapper::EmbeddedDocument.descendants.clear
end
@app.call(env)
end
end
end