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

                StackifyLogger.Shutdown();
            });
        }
Example #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();
        }
Example #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);
                }
            });
        }