private void ScheduleShutdownAction() { try { Configurator.Prerequisites.Scheduler.Advanced.ScheduleOnce(ShutdownTimeout, () => { try { _shutdownAction.Run(); } catch (Exception ex) { ReportFailure(ex); } }); } catch (SchedulerException) // Scheduler has been shut down already. Need to just cleanup synchronously then. { Shutdown(); } }
private void ScheduleShutdownAction() { // InvalidOperationException if scheduler has been shutdown // TODO: apparently the default scheduler implementations don't throw ANYTHING if you try to queue work when shutdown. Need to fix that try { Configurator.Prerequisites.Scheduler.Advanced.ScheduleOnce(ShutdownTimeout, () => { try { _shutdownAction.Run(); } catch (Exception ex) { ReportFailure(ex); } }); } catch (InvalidOperationException) { Shutdown(); } }