Class: SshKeys::ExpiringSoonNotificationWorker
- Inherits:
-
Object
- Object
- SshKeys::ExpiringSoonNotificationWorker
- Includes:
- ApplicationWorker, CronjobQueue
- Defined in:
- app/workers/ssh_keys/expiring_soon_notification_worker.rb
Constant Summary
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/workers/ssh_keys/expiring_soon_notification_worker.rb', line 14 def perform # rubocop:disable CodeReuse/ActiveRecord User.with_ssh_key_expiring_soon.find_each(batch_size: 10_000) do |user| with_context(user: user) do Gitlab::AppLogger.info "#{self.class}: Notifying User #{user.id} about expiring soon ssh key(s)" keys = user.expiring_soon_and_unnotified_keys Keys::ExpiryNotificationService.new(user, { keys: keys, expiring_soon: true }).execute end end # rubocop:enable CodeReuse/ActiveRecord end |