static StackifyTraceListener()
        {
            GlobalEventSystemFacade.SubscribeToPrepareForShutDownEvent(args =>
            {
                StackifyAPILogger.Log("Composite C1 TraceListener shutting down");
                MetricClient.StopMetricsQueue("Composite C1 TraceListener shutting down");

                StackifyLogger.Shutdown();
            });
        }
Пример #2
0
        public static void OnInitialized()
        {
            var hours = int.Parse(Config.SendEveryNHours);

            Log.LogInformation("Composite.Tools.LegacyUrlHandler", string.Format("Send404Mails Thread Timer Started(send emails every {0} hour)", Config.SendEveryNHours));

            _timer = new Timer(Run, null, 60000, 900000);
            GlobalEventSystemFacade.SubscribeToPrepareForShutDownEvent(RunOnShutDown);

            Functions.DeleteOldBrokenLinks();
        }
Пример #3
0
        public static void Initialize()
        {
            SubscribeToDataEvents();

            var cts  = new CancellationTokenSource();
            var task = Task.Run(() => WaitForWriteLockAndStartServiceBusListener(cts.Token));

            GlobalEventSystemFacade.SubscribeToPrepareForShutDownEvent(args =>
            {
                try
                {
                    cts.Cancel();
                    task.Wait(WaitingTimeForCancellationToFinishInMs);
                }
                catch (Exception ex)
                {
                    Log.LogError(nameof(SitemapEventRegistrator), ex);
                }
            });
        }