Skip to content

Commit

Permalink
Use environment variable to set time_frame and batch_size
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevallano committed May 19, 2020
1 parent bd76c81 commit e585272
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/update_tmdb_data.rake
@@ -1,8 +1,8 @@
# To run the rake task: rake "tmdb_data:refresh"
# To run from console: Rake::Task["tmdb_data:refresh"].invoke

TIME_FRAME = 1.week.ago
BATCH_SIZE = 50
TIME_FRAME = (ENV['tmdb_refresh_time_frame_days'] || 7).days.ago
BATCH_SIZE = ENV['tmdb_refresh_batch_size'] || 50

namespace :tmdb_data do
desc 'refresh tmdb_data'
Expand Down
1 change: 0 additions & 1 deletion lib/tmdb_handler.rb
Expand Up @@ -103,7 +103,6 @@ def self.tmdb_handler_update_movie(tmdb_id)
raise TmdbHandlerError.new(msg)
end


movie.update!(
title: updated_data.title,
imdb_id: updated_data.imdb_id,
Expand Down

0 comments on commit e585272

Please sign in to comment.