Method: Offshore::Database#init

Defined in:
lib/offshore/server/database.rb

#initObject



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/offshore/server/database.rb', line 45

def init
  # TODO: how to let these finish and also stall startup.
  # should it be per test
  # what about db reconnections?
  Logger.info(" Database.init")
  
  Offshore::Database.unlock unless ENV['MULTI_OFFSHORE']  # no reason to keep everyone waiting if I'm the only one
  
  if redis.get(SHUTDOWN_KEY)
    Logger.info("   .... database shutting down. Exiting.")
    raise "Database shutting down. No new connections, please."
  end
end