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:
authorStan Hu <stanhu@gmail.com>2019-01-15 09:33:48 +0300
committerStan Hu <stanhu@gmail.com>2019-01-15 11:15:40 +0300
commit6fbbd4ab393f0d56b8636b407a38273b4c77b3db (patch)
treecbea04eaf6149cd370ade6ee26ff095971cdb86f /db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb
parent0e510780a15955b06445fb4c440230151da9ae93 (diff)
Only send one notification for failed remote mirror
Retries in Sidekiq and in the remote mirror scheduler can cause repeated attempts in quick succession if the sync fails. Each failure will then send an e-mail to all project maintainers, which can spam users unnecessarily. Modify the logic to send one notification the first time the mirror fails by setting `error_notification_sent` to `true` and reset the flag after a successful sync. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56222
Diffstat (limited to 'db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb')
-rw-r--r--db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb b/db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb
new file mode 100644
index 00000000000..d8f979a1848
--- /dev/null
+++ b/db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddErrorNotificationSentToRemoteMirrors < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ add_column :remote_mirrors, :error_notification_sent, :boolean
+ end
+end