diff options
author | Stan Hu <stanhu@gmail.com> | 2019-01-14 22:33:48 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-01-15 00:15:40 -0800 |
commit | 6fbbd4ab393f0d56b8636b407a38273b4c77b3db (patch) | |
tree | cbea04eaf6149cd370ade6ee26ff095971cdb86f /db | |
parent | 0e510780a15955b06445fb4c440230151da9ae93 (diff) | |
download | gitlab-ce-6fbbd4ab393f0d56b8636b407a38273b4c77b3db.tar.gz |
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')
-rw-r--r-- | db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 13 insertions, 1 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 diff --git a/db/schema.rb b/db/schema.rb index 87826881d58..c4902116a3a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190103140724) do +ActiveRecord::Schema.define(version: 20190115054216) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1849,6 +1849,7 @@ ActiveRecord::Schema.define(version: 20190103140724) do t.string "encrypted_credentials_salt" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.boolean "error_notification_sent" t.index ["last_successful_update_at"], name: "index_remote_mirrors_on_last_successful_update_at", using: :btree t.index ["project_id"], name: "index_remote_mirrors_on_project_id", using: :btree end |