debian-mirror-gitlab/app/workers/use_key_worker.rb

14 lines
305 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class UseKeyWorker
include Sidekiq::Worker
include DedicatedSidekiqQueue
def perform(key_id)
key = Key.find(key_id)
key.touch(:last_used_at)
rescue ActiveRecord::RecordNotFound
Rails.logger.error("UseKeyWorker: couldn't find key with ID=#{key_id}, skipping job")
false
end
end