Speed up process termination time when Microsoft Graph enabled
By default, the Microsoft Graph connection sleeps for 60 seconds before polling for more data. If the process is terminated, it can take another 60 seconds to terminate.
We can speed this up by waking up every second and and checking whether to terminate.
Filed upstream: https://github.com/tpitale/mail_room/pull/132
Edited by Stan Hu