aviraj

aviraj

I have some quantum jobs configured as part of the elixir configuration

{‘MyJobs.Scheduler’,
[{timeout,10000},
{global,true},
{jobs,
[{post_schedule,
[{schedule,<<“10 7 * * *”>>},
{task,
{‘Post.PostSchedule’,
post_schedules,}}]},
{job_schedule,
[{schedule,<<“1 3 * * *”>>},
{task,
{‘Post.Reminders’,
post_reminders,}}]}]}]}

This is deployed on a server and all jobs run as per schedule. My requirement is to disable/deactivate these jobs on the server without doing a re-deployment of code. I have tried modifying the config file to remove this entire section from the config file, but even after restarting the server and starting the application again, it still runs the jobs at the scheduled times. Does quantum job scheduler pick the job configuration from some other location apart from the config files. Is it possible to stop/deactivate the jobs by making a configuration change or from the command line?

Showing Posts 1 to 3

derek-zhou

derek-zhou

I am not familiar with quantum per se, but i suspect you hit a typical newbie problem like most of us encountered at some stage.
Whatever you put in config/config.exs are compile time config. What you want here is run time config, which you need to fetch the config data yourself, call whatever api yourself.

aviraj

aviraj OP

Thanks for the response. Yes, I am aware of the compile time config. This is a production system and right now we cannot do a deployment. When the application is launched, it picks the config file from a specified location

/xyz/beam -config /opt/config/sys.config

The point is, this config file is read every time and it is editable. I am able to change the pool_timeout values in the configuration file and it applies when the application is restarted. However the changes made to scheduled jobs do not apply. I want to know if there is any way to stop scheduled jobs either by adding something additional to the config files or from the iex command line on the server

hassanRsiddiqi

hassanRsiddiqi

you can always activate and deactivate jobs runtime on server, YourApp.Scheduler.deactivate_job(:ticker) or YourApp.Scheduler.activate_job(:ticker) Only thing you need, is to set the name of your job.

YourApp.Scheduler.new_job()
|> Quantum.Job.set_name(:ticker)
|> Quantum.Job.set_schedule(~e[1 * * * *])
|> Quantum.Job.set_task(fn -> :ok end)
|> YourApp.Scheduler.add_job()

Or from config you can set this way,

config :your_app, YourApp.Scheduler,
  jobs: [
    news_letter: [
      schedule: "@weekly",
      task: {Heartbeat, :send, [:arg1]},
    ]
  ]

more

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews