Oban overuse
It is my opinion that right now Oban is overused in Pleroma. Oban is not an in-memory queue, every job creation is a query to the database, therefore it should be used only when it's actually needed.
Things that do not need Oban but use it:
-
Prefetching preview cards, media proxy prefetch and preload. These tasks just warm the cache, we don't care if they fail or of they get preserved when the node goes down -
Pleroma.Workers.Cron.ClearOauthTokenWorker
,Pleroma.Workers.Cron.StatsWorker
,Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker
(a.k.a everything that uses Oban cron except digest emails). Same argument as the last one. Do we care if StatsWorker runs exactly at the start of each hour and that it's scheduled jobs get preserved between restarts? No, it regenerates stats on reboot anyway,send_after(self(), :refresh, 3600000)
will do