Skip to content

Commit c1f1fc2

Browse files
committedAug 3, 2014
Added Clockwork scheduler with placeholder jobs named that previously run as scheduled tasks on Heroku
1 parent 25acdc6 commit c1f1fc2

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed
 

‎Gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ gem 'slim-rails'
4040
# Postgres
4141
gem 'pg'
4242

43-
43+
# Scheduled tasks
44+
gem 'clockwork'
4445

4546
# Authentication
4647
gem 'omniauth', '~> 1.1.0'

‎Gemfile.lock

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ GEM
135135
choice (0.1.6)
136136
chronic (0.10.2)
137137
chunky_png (1.3.1)
138+
clockwork (0.7.7)
139+
activesupport
140+
tzinfo
138141
codeclimate-test-reporter (0.3.0)
139142
simplecov (>= 0.7.1, < 1.0.0)
140143
coderay (1.1.0)
@@ -707,6 +710,7 @@ DEPENDENCIES
707710
carrierwave-mongoid
708711
carrierwave_backgrounder (= 0.0.8)
709712
chronic
713+
clockwork
710714
codeclimate-test-reporter
711715
coffee-rails (~> 3.2.1)
712716
color

‎Procfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
web: bundle exec puma -C ./config/puma.rb
2-
sidekiq: bundle exec sidekiq -C ./config/sidekiq.yml
2+
sidekiq: bundle exec sidekiq -C ./config/sidekiq.yml
3+
clock: bundle exec clockwork app/clock.rb

‎app/clock.rb

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# IMPORTANT: Coderwall runs in the Pacific Timezone
2+
3+
require_relative '../config/boot'
4+
require_relative '../config/environment'
5+
6+
include Clockwork
7+
8+
every(1.day, 'award:activate:active', at: '00:00') {}
9+
every(1.day, 'award:fresh:stale', at: '00:00') {}
10+
every(1.day, 'cleanup:protips:associate_zombie_upvotes', at: '00:00') {}
11+
every(1.day, 'clear_expired_sessions', at: '00:00') {}
12+
every(1.day, 'facts:system', at: '00:00') {}
13+
every(1.day, 'monitor:auto_tweets_queue', at: '00:00') {}
14+
every(1.day, 'protips:recalculate_scores', at: '00:00') {}
15+
every(1.day, 'search:sync', at: '00:00') {}
16+
every(1.day, 'teams:refresh', at: '00:00') {}

0 commit comments

Comments
 (0)
Please sign in to comment.