Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Run delete-old-unclaimed-attachments in archive cron file.

Tim Abbott6b37f9a290a9
diff --git a/puppet/zulip/files/cron.d/archive-messages b/puppet/zulip/files/cron.d/archive-messages
index 59e17f08a91..50c77d42c7e 100644
--- a/puppet/zulip/files/cron.d/archive-messages
+++ b/puppet/zulip/files/cron.d/archive-messages
@@ -5,3 +5,6 @@ USER=zulip
# Daily cron job for retention policy - archives existing messages based on the policy
# and cleans expired entries from the archive.
0 6 * * * zulip /home/zulip/deployments/current/manage.py archive_messages >/dev/null
+# Daily cron job for cleaning up old, unclaimed attachments and their corresponding files.
+# Ideally should not run at the same time as the previous job, to avoid races.
+0 5 * * * zulip /home/zulip/deployments/current/manage.py delete_old_unclaimed_attachments -f >/dev/null
diff --git a/puppet/zulip/files/cron.d/delete-old-unclaimed-attachments b/puppet/zulip/files/cron.d/delete-old-unclaimed-attachments
deleted file mode 100644
index 7400242460e..00000000000
--- a/puppet/zulip/files/cron.d/delete-old-unclaimed-attachments
+++ /dev/null
@@ -1,6 +0,0 @@
-SHELL=/bin/bash
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-USER=zulip
-
-# Daily cronjob for cleaning up old, unclaimed attachments and their corresponding files.
-0 6 * * * zulip /home/zulip/deployments/current/manage.py delete_old_unclaimed_attachments -f >/dev/null
diff --git a/puppet/zulip/manifests/app_frontend_once.pp b/puppet/zulip/manifests/app_frontend_once.pp
index 4d3ba3bb9ed..148015d15ed 100644
--- a/puppet/zulip/manifests/app_frontend_once.pp
+++ b/puppet/zulip/manifests/app_frontend_once.pp
@@ -67,14 +67,6 @@ class zulip::app_frontend_once {
source => 'puppet:///modules/zulip/cron.d/archive-messages',
}
- file { '/etc/cron.d/delete-old-unclaimed-attachments':
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- source => 'puppet:///modules/zulip/cron.d/delete-old-unclaimed-attachments',
- }
-
file { '/etc/cron.d/clearsessions':
ensure => file,
owner => 'root',