diff options
Diffstat (limited to 'app/workers/ssh_keys/update_last_used_at_worker.rb')
-rw-r--r-- | app/workers/ssh_keys/update_last_used_at_worker.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/workers/ssh_keys/update_last_used_at_worker.rb b/app/workers/ssh_keys/update_last_used_at_worker.rb new file mode 100644 index 00000000000..80c2132b8d8 --- /dev/null +++ b/app/workers/ssh_keys/update_last_used_at_worker.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module SshKeys + class UpdateLastUsedAtWorker + include ApplicationWorker + + idempotent! + deduplicate :until_executed + data_consistency :sticky + + feature_category :source_code_management + + def perform(key_id) + key = Key.find_by_id(key_id) + + return unless key + + Keys::LastUsedService.new(key).execute + end + end +end |