Skip to content

Commit

Permalink
Oban config tweaks
Browse files Browse the repository at this point in the history
- Re-enable daily StatsProcessor job
- Don't prune for 12 hours
- MailDeliverer only gets 1 attempt
- Increase queue workers for email, feeds
  • Loading branch information
jerodsanto committed Nov 21, 2023
1 parent d7e63e0 commit c1e83da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ config :changelog,

config :changelog, Oban,
repo: Changelog.Repo,
queues: [audio_updater: 10, scheduled: 5, email: 1, feeds: 1],
queues: [audio_updater: 2, scheduled: 5, email: 5, feeds: 5],
plugins: [Oban.Plugins.Pruner]

config :changelog, Changelog.Mailer, adapter: Bamboo.LocalAdapter
Expand Down
4 changes: 2 additions & 2 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ config :elixir,

config :changelog, Oban,
plugins: [
{Oban.Plugins.Pruner, max_age: 300},
{Oban.Plugins.Pruner, max_age: 43_200}, # 12 hours
{Oban.Plugins.Cron,
timezone: "US/Central",
crontab: [
{"00 3 * * *", Changelog.ObanWorkers.SlackImporter},
{"30 3 * * *", Changelog.ObanWorkers.Bouncer},
# {"00 4 * * *", Changelog.ObanWorkers.StatsProcessor},
{"00 4 * * *", Changelog.ObanWorkers.StatsProcessor},
{"* * * * *", Changelog.ObanWorkers.NewsPublisher}
]}
]
2 changes: 1 addition & 1 deletion lib/changelog/oban_workers/mail_deliverer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Changelog.ObanWorkers.MailDeliverer do
This module defines the Oban worker for delivering all email. We no longer use
Bamboo's `deliver_later/1` function directly, using Oban instead.
"""
use Oban.Worker, queue: :email, unique: [fields: [:args, :queue], period: 60]
use Oban.Worker, queue: :email, unique: [fields: [:args, :queue], period: 60], max_attempts: 1

alias Changelog.{Episode, EpisodeGuest, EpisodeRequest, Mailer, NewsItem,
NewsItemComment, Newsletters, Person, Podcast, Repo, Subscription}
Expand Down

0 comments on commit c1e83da

Please sign in to comment.