Reputation: 15156
I have tons of quantum
jobs that generates log trash inside my iex
. From my phoenix
app:
# config/dev.exs
config :quantum, MyApp,
cron: [
# Tons of jobs here
]
So, I want this part to be included in configs only from the phoenix.server, but not from IEx. How could I do that?
Upvotes: 1
Views: 196
Reputation: 2155
I'm on elixir 1.15. In my case, IEx.started?
returns false
in the runtime.exs
and prod.exs
file. My assumption is this is because these files are executed before whatever state IEx.started?
relies upon is updated.
In my case, the way to disable quantum in IEx on prod was to create .iex.exs
file and remove the scheduler process:
Supervisor.terminate_child(App.Supervisor, App.Scheduler)
Supervisor.delete_child(App.Supervisor, App.Scheduler)
Upvotes: 0
Reputation: 222198
You can check if iex
is running using IEx.started?/0
. If you put this in unless
and wrap the config
call inside it, the config will only be added if iex
is not running:
# config/dev.exs
unless IEx.started? do
config :quantum, MyApp,
cron: [
# Tons of jobs here
]
end
Upvotes: 3