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>2020-04-08 03:09:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 03:09:30 +0300
commit060c842402c00f830a810702600cbe39dfa6cf62 (patch)
tree743bd65ac0c1d4d6518ae8cdd4af5718ec7fb890 /app/workers
parent6867eff1f997a881cd3ea64109f7ba2d4b42fde4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml7
-rw-r--r--app/workers/users/create_statistics_worker.rb19
2 files changed, 26 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index e37fa52f5ff..3ee8901b23b 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -262,6 +262,13 @@
:resource_boundary: :unknown
:weight: 1
:idempotent:
+- :name: cronjob:users_create_statistics
+ :feature_category: :users
+ :has_external_dependencies:
+ :urgency: :low
+ :resource_boundary: :unknown
+ :weight: 1
+ :idempotent:
- :name: deployment:deployments_finished
:feature_category: :continuous_delivery
:has_external_dependencies:
diff --git a/app/workers/users/create_statistics_worker.rb b/app/workers/users/create_statistics_worker.rb
new file mode 100644
index 00000000000..fb1b192577f
--- /dev/null
+++ b/app/workers/users/create_statistics_worker.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Users
+ class CreateStatisticsWorker # rubocop:disable Scalability/IdempotentWorker
+ include ApplicationWorker
+ # 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