Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Commit

Permalink
Minor fix & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Petschnig committed Apr 28, 2013
1 parent b3184eb commit b9fe283
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion config/schedule.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set :output, File.expand_path("../../logs/cron_log.log", __FILE__)
set :output, File.expand_path("../../log/cron_log.log", __FILE__)

every 2.minutes do
rake "twitter:tweet_translation"
Expand Down
12 changes: 0 additions & 12 deletions lib/tasks/application.rake
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
namespace :twitter do
desc "Fetch new tweets and translate them"
task :translate => :environment do
level = Rails.env == 'production' ? ::ActiveSupport::BufferedLogger::INFO : ::ActiveSupport::BufferedLogger::DEBUG
logger = ::ActiveSupport::BufferedLogger.new(
File.join(Rails.root, 'log', "#{Time.new.strftime('%Y-%m')}.rake.twitter.translate.#{Rails.env}.log"), level)
logger.auto_flushing = true
Rails.logger = logger
TranslationJob.fetch_and_translate
end

desc "Fetch new tweets, translate them and tweet them"
task :tweet_translation => :environment do
level = Rails.env == 'production' ? ::ActiveSupport::BufferedLogger::INFO : ::ActiveSupport::BufferedLogger::DEBUG
logger = ::ActiveSupport::BufferedLogger.new(
File.join(Rails.root, 'log', "#{Time.new.strftime('%Y-%m')}.rake.twitter.tweet_translation.#{Rails.env}.log"), level)
logger.auto_flushing = true
Rails.logger = logger
logger.info '** Starting rake twitter:tweet_translation '.ljust(80, '*')
TranslationJob.fetch_translate_and_tweet
logger.info '** Finished. '.ljust(80, '*')
end
end

0 comments on commit b9fe283

Please sign in to comment.