Skip to content

Commit

Permalink
restart scraper on scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
wwahammy committed Jun 18, 2018
1 parent d2d6fc8 commit 0d06df4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gem 'chromedriver-helper'
gem 'clockwork'
gem 'foundation-rails', '~> 5'
gem 'haml-rails'
gem 'platform-api'
gem 'newrelic_rpm'
gem 'oj'
gem 'puma'
Expand Down
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ GEM
debug_inspector (0.0.3)
erubi (1.7.1)
erubis (2.7.0)
excon (0.62.0)
execjs (2.7.0)
ffi (1.9.25)
font-awesome-rails (4.7.0.4)
Expand All @@ -89,6 +90,11 @@ GEM
haml (>= 4.0.6, < 6.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
heroics (0.0.24)
erubis (~> 2.0)
excon
moneta
multi_json (>= 1.9.2)
html2haml (2.2.0)
erubis (~> 2.7.0)
haml (>= 4.0, < 6)
Expand All @@ -111,6 +117,8 @@ GEM
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
moneta (0.8.1)
multi_json (1.13.1)
newrelic_rpm (5.2.0.345)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
Expand All @@ -119,6 +127,9 @@ GEM
parser (2.5.1.0)
ast (~> 2.4.0)
pg (0.20.0)
platform-api (2.1.0)
heroics (~> 0.0.23)
moneta (~> 0.8.1)
powerpack (0.1.2)
pry (0.11.3)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -250,6 +261,7 @@ DEPENDENCIES
newrelic_rpm
oj
pg (= 0.20)
platform-api
pry-rails
puma
rabl
Expand Down
9 changes: 9 additions & 0 deletions lib/tasks/restart_scraper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'platform-api'

namespace :scraper do
desc 'restarts scraper b/c of chrome memory leaks'
task restart_scraper: :environment do
heroku = PlatformAPI.connect_oauth(ENV['PLATFORM_OAUTH_TOKEN'])
heroku.dyno.restart('world-cup-json', 'clock.1')
end
end

0 comments on commit 0d06df4

Please sign in to comment.