lib/legion/data/settings.rb in legion-data-0.2.0 vs lib/legion/data/settings.rb in legion-data-1.1.2
- old
+ new
@@ -1,17 +1,17 @@
module Legion
module Data
module Settings
def self.default
{
- connected: false,
- cache: cache,
- connection: connection,
- creds: creds,
- migrations: migrations,
- models: models
-
+ connected: false,
+ cache: cache,
+ connection: connection,
+ creds: creds,
+ migrations: migrations,
+ models: models,
+ connect_on_start: true
}
end
def self.models
{
@@ -33,11 +33,11 @@
{
log: false,
log_connection_info: false,
log_warn_duration: 1,
sql_log_level: 'debug',
- max_connections: 32
+ max_connections: 10
}
end
def self.creds
{
@@ -57,6 +57,12 @@
ttl: 60
}
end
end
end
+end
+
+begin
+ Legion::Settings.merge_settings('data', Legion::Data::Settings.default) if Legion.const_defined?('Settings')
+rescue StandardError => e
+ Legion::Logging.fatal(e.message) if Legion::Logging.method_defined?(:fatal)
end