Skip to content

Commit

Permalink
Fix: intervals may not always be started in an async block.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jul 25, 2023
1 parent 7233511 commit 05c176d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/slack-ruby-bot-server/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ def start_from_database!
end

def start_intervals!
@intervals.each_pair do |period, calls_with_options|
calls_with_options.each do |call_with_options|
call, options = *call_with_options
_every period, options do
call.call
::Async::Reactor.run do
@intervals.each_pair do |period, calls_with_options|
calls_with_options.each do |call_with_options|
call, options = *call_with_options
_every period, options do
call.call
end
end
end
end
Expand Down

0 comments on commit 05c176d

Please sign in to comment.