feat: new configuration system (and schema) (#2819)

This commit is contained in:
Adam Cooke
2024-02-26 12:41:57 +00:00
committed by GitHub
parent 1c5ff5a9a6
commit 0163ac3d10
77 changed files with 1840 additions and 593 deletions
+3 -3
View File
@@ -7,8 +7,8 @@
class MigrationWaiter
ATTEMPTS = ENV.fetch("MIGRATION_WAITER_ATTEMPTS", 120)
SLEEP_TIME = ENV.fetch("MIGRATION_WAITER_SLEEP_TIME", 2)
ATTEMPTS = Postal::Config.migration_waiter.attempts
SLEEP_TIME = Postal::Config.migration_waiter.sleep_time
class << self
@@ -35,7 +35,7 @@ class MigrationWaiter
def wait_if_appropriate
# Don't wait if not configured
return unless ENV.fetch("MIGRATION_WAITER_ENABLED", "false") == "true"
return unless Postal::Config.migration_waiter.enabled?
# Don't wait in the console, rake tasks or rails commands
return if console? || rake_task? || rails_command?