Class: Etna::SynchronizeDb

Inherits:
Object
  • Object
show all
Defined in:
lib/etna/synchronize_db.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ SynchronizeDb

Returns a new instance of SynchronizeDb.



3
4
5
# File 'lib/etna/synchronize_db.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
# File 'lib/etna/synchronize_db.rb', line 7

def call(env)
  # Do a coarse checkout of the connection
  Etna::Application.instance.db.synchronize do
    @app.call(env)
  end
end