Example #1
0
 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();
     }
 }
Example #2
0
 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();
     }
 }