Skip to content

Commit

Permalink
Merge pull request #225 from mario-amazing/master
Browse files Browse the repository at this point in the history
Fix rails 7.1 broadcast error
  • Loading branch information
printercu authored Dec 18, 2023
2 parents cd2d3d8 + f54b36d commit d048f42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tasks/telegram-bot.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ namespace :telegram do
Rake::Task['environment'].invoke
if ENV.fetch('LOG_TO_STDOUT') { Rails.env.development? }.present?
console = ActiveSupport::Logger.new(STDERR)
Rails.logger.extend ActiveSupport::Logger.broadcast console
if ::Rails.logger.respond_to?(:broadcast_to)
::Rails.logger.broadcast_to(console)
else
Rails.logger.extend ActiveSupport::Logger.broadcast console
end
end
Telegram::Bot::UpdatesPoller.start(ENV['BOT'].try!(:to_sym) || :default)
end
Expand Down

0 comments on commit d048f42

Please sign in to comment.