Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
don't run the worker config in the handler
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler committed Oct 18, 2023
1 parent cdf94ca commit ad4fc9a
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions app/worker/env_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@

require 'superconfig'

EnvConfig = SuperConfig.new do
# We don't have RAILS_ENV in ruby
if ENV.fetch('CODE_ENVIRONMENT', 'development') == 'development'
mandatory :LOCALSTACK_ENDPOINT, :string
# Have to be the same as in localstack to simulate authentication
mandatory :AWS_ACCESS_KEY_ID, :string
mandatory :AWS_SECRET_ACCESS_KEY, :string
optional :WCA_HOST, :string, ''
optional :CODE_ENVIRONMENT, 'development'
else
mandatory :QUEUE_URL, :string
mandatory :WCA_HOST, :string
mandatory :CODE_ENVIRONMENT, :string
# Don't run this on the handler
unless defined?(Rails)
EnvConfig = SuperConfig.new do
# We don't have RAILS_ENV in ruby
if ENV.fetch('CODE_ENVIRONMENT', 'development') == 'development'
mandatory :LOCALSTACK_ENDPOINT, :string
# Have to be the same as in localstack to simulate authentication
mandatory :AWS_ACCESS_KEY_ID, :string
mandatory :AWS_SECRET_ACCESS_KEY, :string
optional :WCA_HOST, :string, ''
optional :CODE_ENVIRONMENT, 'development'
else
mandatory :QUEUE_URL, :string
mandatory :WCA_HOST, :string
mandatory :CODE_ENVIRONMENT, :string
end
# We even need the AWS_REGION in dev because we fake authenticate with localstack
mandatory :AWS_REGION, :string
mandatory :PROMETHEUS_EXPORTER, :string
mandatory :DYNAMO_REGISTRATIONS_TABLE, :string
end
# We even need the AWS_REGION in dev because we fake authenticate with localstack
mandatory :AWS_REGION, :string
mandatory :PROMETHEUS_EXPORTER, :string
mandatory :DYNAMO_REGISTRATIONS_TABLE, :string
end

0 comments on commit ad4fc9a

Please sign in to comment.