Commit f582564c authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'fix-shared-runners-minutes' into 'master'

Fix shared runners minutes

Closes gitlab-ce#33213

See merge request !2275
parents 4c37cf27 6ba05b4d
...@@ -7,13 +7,15 @@ class ClearSharedRunnersMinutesWorker ...@@ -7,13 +7,15 @@ class ClearSharedRunnersMinutesWorker
def perform def perform
return unless try_obtain_lease return unless try_obtain_lease
ProjectStatistics.update_all( NamespaceStatistics.where.not(shared_runners_seconds: 0)
shared_runners_seconds: 0, .update_all(
shared_runners_seconds_last_reset: Time.now) shared_runners_seconds: 0,
shared_runners_seconds_last_reset: Time.now)
NamespaceStatistics.update_all( ProjectStatistics.where.not(shared_runners_seconds: 0)
shared_runners_seconds: 0, .update_all(
shared_runners_seconds_last_reset: Time.now) shared_runners_seconds: 0,
shared_runners_seconds_last_reset: Time.now)
end end
private private
......
---
title: Fix shared runners minutes query to update only projects with used allowance
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment