summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-02-27 12:07:05 +0000
committerNick Thomas <nick@gitlab.com>2019-02-27 12:07:05 +0000
commita5174cf0fcfd0ae77d25ac5208b7aa371d7d7b73 (patch)
tree6610d4dbd0b47f666586e7f5e0e87a285a3426c5 /app/workers
parent61c1509cc992959ac5021d10825d5dbf9dd2c091 (diff)
parent5ae9a44aa17c8929627cc450f936cd960c143e25 (diff)
downloadgitlab-ce-a5174cf0fcfd0ae77d25ac5208b7aa371d7d7b73.tar.gz
Merge branch '42086-project-fetch-statistics-api-http-only' into 'master'57125-heatmap-chart-type
Resolve "Project fetch statistics API (HTTP only)" Closes #42086 See merge request gitlab-org/gitlab-ce!23596
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml1
-rw-r--r--app/workers/project_daily_statistics_worker.rb13
2 files changed, 14 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index d0fc130b04f..337f39b2091 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -146,3 +146,4 @@
- repository_cleanup
- delete_stored_files
- import_issues_csv
+- project_daily_statistics
diff --git a/app/workers/project_daily_statistics_worker.rb b/app/workers/project_daily_statistics_worker.rb
new file mode 100644
index 00000000000..101f5c28459
--- /dev/null
+++ b/app/workers/project_daily_statistics_worker.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ProjectDailyStatisticsWorker
+ include ApplicationWorker
+
+ def perform(project_id)
+ project = Project.find_by_id(project_id)
+
+ return unless project&.repository&.exists?
+
+ Projects::FetchStatisticsIncrementService.new(project).execute
+ end
+end