2020-04-07 20:09:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Users
|
|
|
|
class CreateStatisticsWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
2021-04-30 14:10:09 -04:00
|
|
|
|
2021-07-21 08:09:35 -04:00
|
|
|
data_consistency :always
|
|
|
|
|
2020-04-07 20:09:30 -04:00
|
|
|
# rubocop:disable Scalability/CronWorkerContext
|
|
|
|
# This worker does not perform work scoped to a context
|
|
|
|
include CronjobQueue
|
|
|
|
# rubocop:enable Scalability/CronWorkerContext
|
|
|
|
|
|
|
|
feature_category :users
|
|
|
|
|
|
|
|
def perform
|
|
|
|
UsersStatistics.create_current_stats!
|
|
|
|
rescue ActiveRecord::RecordInvalid => exception
|
|
|
|
Gitlab::ErrorTracking.track_exception(exception)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|