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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-12 00:08:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-12 00:08:18 +0300
commitd5012fff67191be53070d024a89195a666a581ed (patch)
tree08d4334c0202f365a5513dd2147d5a411fe05bcb /app/workers
parent1a2f754734eb189e371e25e685413808f69a7f2c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/ci/runners/stale_machines_cleanup_cron_worker.rb2
-rw-r--r--app/workers/gitlab/github_gists_import/import_gist_worker.rb23
2 files changed, 23 insertions, 2 deletions
diff --git a/app/workers/ci/runners/stale_machines_cleanup_cron_worker.rb b/app/workers/ci/runners/stale_machines_cleanup_cron_worker.rb
index 9a11db33fb6..9407e7c0e0a 100644
--- a/app/workers/ci/runners/stale_machines_cleanup_cron_worker.rb
+++ b/app/workers/ci/runners/stale_machines_cleanup_cron_worker.rb
@@ -15,7 +15,7 @@ module Ci
idempotent!
def perform
- result = ::Ci::Runners::StaleMachinesCleanupService.new.execute
+ result = ::Ci::Runners::StaleManagersCleanupService.new.execute
log_extra_metadata_on_done(:status, result.status)
log_hash_metadata_on_done(result.payload)
end
diff --git a/app/workers/gitlab/github_gists_import/import_gist_worker.rb b/app/workers/gitlab/github_gists_import/import_gist_worker.rb
index fb7fb661f4c..8cbbe35dd30 100644
--- a/app/workers/gitlab/github_gists_import/import_gist_worker.rb
+++ b/app/workers/gitlab/github_gists_import/import_gist_worker.rb
@@ -14,12 +14,21 @@ module Gitlab
sidekiq_options dead: false, retry: 5
+ sidekiq_retries_exhausted do |msg, _|
+ new.track_gist_import('failed', msg['args'][0])
+ end
+
def perform(user_id, gist_hash, notify_key)
gist = ::Gitlab::GithubGistsImport::Representation::Gist.from_json_hash(gist_hash)
with_logging(user_id, gist.github_identifiers) do
result = importer_class.new(gist, user_id).execute
- error(user_id, result.errors, gist.github_identifiers) unless result.success?
+ if result.success?
+ track_gist_import('success', user_id)
+ else
+ error(user_id, result.errors, gist.github_identifiers)
+ track_gist_import('failed', user_id)
+ end
JobWaiter.notify(notify_key, jid)
end
@@ -29,6 +38,18 @@ module Gitlab
raise
end
+ def track_gist_import(status, user_id)
+ user = User.find(user_id)
+
+ Gitlab::Tracking.event(
+ self.class.name,
+ 'create',
+ label: 'github_gist_import',
+ user: user,
+ status: status
+ )
+ end
+
private
def importer_class