+ running = @registry[:running]
+ now = Time.now
+ running.each do |id, poll|
+ duration = poll.ends_at - Time.now
+ if duration > 0
+ # keep the poll running
+ @bot.timer.add_once(duration) { count_votes(poll.id) }
+ else
+ # the poll expired while the bot was out, end it
+ count_votes(poll.id)
+ end
+ end