Project

General

Profile

« Previous | Next » 

Revision a089227c

Added by Marc Dequènes almost 14 years ago

  • ID a089227ca94121115f46e5998b497fa102787398

[fix/evol] work on better Interface/Task/Conversation/… sync and bot stop action in order to avoid races and locks

View differences:

bin/postman
end
end
def ask_to_stop
def stop(condition)
super do
self.services.imap.stop_mail_check
end
end
protected
def ready_to_stop?
# TODO: also wait for messages being processed to be finished (or try to interrupt cleanly if possible in :quickly condition)
super and not self.services.imap.connected?
end
......
bot = reg.bot
trap('INT') do
bot.ask_to_stop
bot.stop(:quickly)
end
trap('TERM') do
bot.ask_to_stop
bot.stop(:quickly)
end
bot.run

Also available in: Unified diff