I’m using Oban.Pro.Worker
and would like to access the timezone in the new/2
method; currently I see cron
, cron_expr
, and cron_name
but not the timezone passed along:
config :example, Oban,
plugins: [
Oban.Pro.Plugins.DynamicLifeline,
{
Oban.Pro.Plugins.DynamicCron,
sync_mode: :automatic,
crontab: [
{"* * * * 1-5", Example.Worker, timezone: "America/New_York"}
]
}
]
opts: [
stages: [
{Oban.Pro.Stages.Standard, []},
{Oban.Pro.Stages.Structured,
%Oban.Pro.Stages.Structured{worker: Example.Worker}},
{Oban.Pro.Stages.Hooks, %Oban.Pro.Stages.Hooks{modules: []}}
],
worker: "Example.Worker",
meta: %{
cron: true,
cron_expr: "* * * * 1-5",
cron_name: "Example.Worker"
}
]
Any advice besides passing the timezone again as an argument?
Thanks!