Hi everyone, i’m trying to execute a task every week day at 5:30 pm. The basic example with * * * * * for executing the task every single minute is working fine, so the configuration is ok. But the specific case i desire is not working
config :bot, Bot.Scheduler,
jobs: [
{"30 17 * * 1-5", fn -> Server.greet_kommitters() end},
]
The docs says to use weekly a task you need the following code
config :your_app, YourApp.Scheduler,
jobs: [
news_letter: [
schedule: "@weekly",
task: {Heartbeat, :send, [:arg1]},
]
]
Here is the link to the docs https://hexdocs.pm/quantum/configuration.html
1 Like
Also a named job seems to be a better option then an anonymous function, easier to spot on the logs too.
1 Like