summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2018-12-05 12:22:52 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2018-12-11 23:08:17 -0300
commitb65cb237cee0b1a8dfdc21a09f2b181d0edf5bde (patch)
treedffc212c6e7ca84c1e61ec1625e53548c0b6de18 /app/finders
parent80eebd8e33c5f2f26bc0fdd233d9d92c51edd242 (diff)
downloadgitlab-ce-b65cb237cee0b1a8dfdc21a09f2b181d0edf5bde.tar.gz
Send a notification email on mirror update errors
The email is sent to project maintainers containing the last mirror update error. This will allow maintainers to set alarms and react accordingly.
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/remote_mirror_finder.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/finders/remote_mirror_finder.rb b/app/finders/remote_mirror_finder.rb
new file mode 100644
index 00000000000..420db0077aa
--- /dev/null
+++ b/app/finders/remote_mirror_finder.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoteMirrorFinder
+ attr_accessor :params
+
+ def initialize(params)
+ @params = params
+ end
+
+ # rubocop: disable CodeReuse/ActiveRecord
+ def execute
+ RemoteMirror.find_by(id: params[:id])
+ end
+ # rubocop: enable CodeReuse/ActiveRecord
+end