Skip to main content

Parker Selbert



Oban - Graceful Shutdown

Did you know that when an app shuts down Oban pauses all queues and waits for jobs to finish? The time is configurable and defaults to 15 seconds, short enough for most deployments.
# Change the default to 30 seconds
config :my_app, Oban,
  repo: MyApp.Repo,
  queues: [default: 10]
  shutdown_grace_period: :timer.seconds(30)

# Wait up to an hour for long running jobs in a blue-green style deply
config :my_app, Oban,
  shutdown_grace_period: :timer.minutes(60)

© 2021 Zest Creative, LLC