Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/workers/prune_old_events_worker.rb2
-rw-r--r--config/initializers/1_settings.rb2
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fea56a6ef21..1d42acfe363 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.12.0 (unreleased)
- Add ability to fork to a specific namespace using API. (ritave)
- Cleanup misalignments in Issue list view !6206
+ - Prune events older than 12 months. @ritave <olaf@tomalka.me>
- Prepend blank line to `Closes` message on merge request linked to issue (lukehowell)
- Prune events older than 12 months.
- Filter tags by name !6121
diff --git a/app/workers/prune_old_events_worker.rb b/app/workers/prune_old_events_worker.rb
index a0182fc67d0..d75083f9ab1 100644
--- a/app/workers/prune_old_events_worker.rb
+++ b/app/workers/prune_old_events_worker.rb
@@ -3,6 +3,6 @@ class PruneOldEventsWorker
def perform
# Contribution calendar shows maximum 12 months of events
- Event.where('created_at < ?', (12.months + 1.day).ago).destroy_all
+ Event.delete(Event.unscoped.where('created_at < ?', (12.months + 1.day).ago).limit(10_000).pluck(:id))
end
end
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 2fac3e34dc5..195108b921b 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -300,7 +300,7 @@ Settings.cron_jobs['remove_expired_group_links_worker'] ||= Settingslogic.new({}
Settings.cron_jobs['remove_expired_group_links_worker']['cron'] ||= '10 0 * * *'
Settings.cron_jobs['remove_expired_group_links_worker']['job_class'] = 'RemoveExpiredGroupLinksWorker'
Settings.cron_jobs['prune_old_events_worker'] ||= Settingslogic.new({})
-Settings.cron_jobs['prune_old_events_worker']['cron'] ||= '0 0 * * *'
+Settings.cron_jobs['prune_old_events_worker']['cron'] ||= '* */6 * * *'
Settings.cron_jobs['prune_old_events_worker']['job_class'] = 'PruneOldEventsWorker'
#