From 1270f345655b89aaadee3b02595f84440743116f Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Sat, 16 Mar 2024 16:40:52 -0600 Subject: [PATCH] Hotfix jobs scheduling --- elixir/apps/domain/lib/domain/jobs.ex | 2 +- elixir/config/runtime.exs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/elixir/apps/domain/lib/domain/jobs.ex b/elixir/apps/domain/lib/domain/jobs.ex index ded6505f9..f5dc3e21c 100644 --- a/elixir/apps/domain/lib/domain/jobs.ex +++ b/elixir/apps/domain/lib/domain/jobs.ex @@ -16,7 +16,7 @@ defmodule Domain.Jobs do Enum.flat_map(module.__handlers__(), fn {name, interval} -> handler_config = Keyword.get(config, name, []) - if Keyword.get(handler_config, :enabled, true) do + if Keyword.get(config, :enabled, true) and Keyword.get(handler_config, :enabled, true) do [ Supervisor.child_spec( {Domain.Jobs.Executors.Global, {{module, name}, interval, handler_config}}, diff --git a/elixir/config/runtime.exs b/elixir/config/runtime.exs index baf56fd7b..d523f841f 100644 --- a/elixir/config/runtime.exs +++ b/elixir/config/runtime.exs @@ -68,6 +68,8 @@ if config_env() == :prod do # Enable background jobs only on dedicated nodes config :domain, Domain.Tokens.Jobs, enabled: compile_config!(:background_jobs_enabled) + config :domain, Elixir.Domain.Billing.Jobs, enabled: compile_config!(:background_jobs_enabled) + config :domain, Domain.Auth.Adapters.GoogleWorkspace.Jobs, enabled: compile_config!(:background_jobs_enabled)