コード例 #1
0
        private static void StopBackgroundTasks()
        {
            logger.Info("Stopping Background Processes...");

            // Cancel background processes
            if (_processManager != null)
            {
                _processManager.CancelAllProcesses();
            }

            _processManager = null;
        }
コード例 #2
0
        public async Task Invoke(HttpContext httpContext)
        {
            try
            {
                Log.For(this).Info("Running background tasks ...");
                await BackgroundProcessManager.Run();

                Log.For(this).Info("Finished running background tasks ...");
            }
            catch (Exception ex)
            {
                Log.For(this).Error(ex, "Failed to run the background tasks because : " + ex.ToFullMessage());
            }
        }
コード例 #3
0
 public Task Invoke(HttpContext httpContext) => BackgroundProcessManager.Run();