Skip to content

Commit bfecce7

Browse files
committed
Restored teams refresh task as a sidekiq job
1 parent 2283cb0 commit bfecce7

File tree

3 files changed

+14
-119
lines changed

3 files changed

+14
-119
lines changed

app/clock.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
SearchSyncJob.perform_async
4141
end
4242

43-
every(1.day, 'teams:refresh', at: '00:00') {}
43+
every(1.day, 'teams:refresh', at: '05:00') do
44+
TeamsRefreshJob.perform_async
45+
end
4446

4547
# This is tied with broken code. Probably should delete
4648
every(1.day, 'facts:system', at: '00:00') {}

app/jobs/teams_refresh_job.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class TeamsRefreshJob
2+
include Sidekiq::Worker
3+
4+
sidekiq_options queue: :low
5+
6+
def perform
7+
Team.all.each do |team|
8+
ProcessTeamJob.perform_async('recalculate', team.id)
9+
end
10+
end
11+
end

lib/tasks/teams.rake

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)