Skip to content

Commit

Permalink
oban
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Dec 8, 2023
1 parent 6995fc4 commit 5191c6b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 40 deletions.
49 changes: 26 additions & 23 deletions flavours/classic/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,32 @@ repo_path = System.get_env("DB_REPO_PATH", "priv/repo")
config :bonfire, Bonfire.Common.Repo, priv: repo_path
config :bonfire, Bonfire.Common.TestInstanceRepo, priv: repo_path

oban_opts =

config :bonfire, Oban,
repo: Bonfire.Common.Repo,
insert_trigger: false, # avoid extra PubSub chatter as we don't need that much precision
queues: [
federator_incoming: 10,
federator_outgoing: 10,
remote_fetcher: 5,
import: 2,
deletion: 1
],
plugins: [
{Oban.Plugins.Pruner, max_age: 60 * 60 * 24 * 7}, # delete job history after 7 days
{Oban.Plugins.Lifeline, rescue_after: :timer.minutes(60)}, # rescue orphaned jobs
{Oban.Plugins.Cron,
crontab: [
{"@daily", ActivityPub.Pruner.PruneDatabaseWorker, max_attempts: 1}
]}
]

config :activity_pub, Oban,
queues: false, # to avoid running it twice
oban_opts =
config :bonfire, Oban,
repo: Bonfire.Common.Repo,
# avoid extra PubSub chatter as we don't need that much precision
insert_trigger: false,
queues: [
federator_incoming: 10,
federator_outgoing: 10,
remote_fetcher: 5,
import: 2,
deletion: 1
],
plugins: [
#  delete job history after 7 days
{Oban.Plugins.Pruner, max_age: 60 * 60 * 24 * 7},
# rescue orphaned jobs
{Oban.Plugins.Lifeline, rescue_after: :timer.minutes(60)},
{Oban.Plugins.Cron,
crontab: [
{"@daily", ActivityPub.Pruner.PruneDatabaseWorker, max_attempts: 1}
]}
]

config :activity_pub, Oban,
# to avoid running it twice
queues: false,
repo: Bonfire.Common.Repo

config :activity_pub, ActivityPub.Federator.HTTP.RateLimit,
Expand Down
Loading

0 comments on commit 5191c6b

Please sign in to comment.