Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Add Oban config to releases

Uku Taht2a7e77ab1040
diff --git a/config/releases.exs b/config/releases.exs
index 59fff4160b..0b3c448324 100644
--- a/config/releases.exs
+++ b/config/releases.exs
@@ -46,6 +46,7 @@ twitter_consumer_secret = System.get_env("TWITTER_CONSUMER_SECRET")
twitter_token = System.get_env("TWITTER_ACCESS_TOKEN")
twitter_token_secret = System.get_env("TWITTER_ACCESS_TOKEN_SECRET")
postmark_api_key = System.get_env("POSTMARK_API_KEY")
+cron_enabled = String.to_existing_atom(System.get_env("CRON_ENABLED", "false"))
config :plausible,
admin_user: admin_user,
@@ -126,4 +127,25 @@ config :plausible, :twitter,
token: twitter_token,
token_secret: twitter_token_secret
+crontab = [
+ {"0 * * * *", Plausible.Workers.SendSiteSetupEmails}, # hourly
+ {"0 * * * *", Plausible.Workers.SendEmailReports}, # hourly
+ {"0 0 * * *", Plausible.Workers.FetchTweets}, # Daily at midnight
+ {"0 12 * * *", Plausible.Workers.SendTrialNotifications}, # Daily at midday
+ {"0 12 * * *", Plausible.Workers.SendCheckStatsEmails}, # Daily at midday
+ {"*/10 * * * *", Plausible.Workers.ProvisionSslCertificates}, # Every 10 minutes
+]
+
+config :plausible, Oban,
+ repo: Plausible.Repo,
+ queues: [
+ provision_ssl_certificates: 1,
+ fetch_tweets: 1,
+ check_stats_emails: 1,
+ email_reports: 1,
+ site_setup_emails: 1,
+ trial_notification_emails: 1
+ ],
+ crontab: if cron_enabled, do: crontab, else: false
+
config :logger, level: :warn