diff --git a/.env.development b/.env.development index 475452dd94..4131ad42d6 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,5 @@ +DFE_ANALYTICS_ASYNC=false +DFE_ANALYTICS_LOG_ONLY=true DFE_SIGN_IN_REDIRECT_URL=http://localhost:3000/auth/dfe/callback DISABLE_EMAILS=false DOCUMENTS_S3_BUCKET=test_bucket diff --git a/config/initializers/dfe_analytics.rb b/config/initializers/dfe_analytics.rb index 236d16d9dc..01bae5e4f6 100644 --- a/config/initializers/dfe_analytics.rb +++ b/config/initializers/dfe_analytics.rb @@ -1,11 +1,11 @@ DfE::Analytics.configure do |config| # Whether to log events instead of sending them to BigQuery. # - config.log_only = false + config.log_only = ActiveModel::Type::Boolean.new.cast(ENV.fetch("DFE_ANALYTICS_LOG_ONLY", false)) # Whether to use ActiveJob or dispatch events immediately. # - config.async = true + config.async = ActiveModel::Type::Boolean.new.cast(ENV.fetch("DFE_ANALYTICS_ASYNC", false)) # Which ActiveJob queue to put events on #