Exemple #1
0
        private static void OnEveryFiveMinutes()
        {
            try
            {
                BotLog.Write(0, "MainCycle", "Five-minute entry");

                try
                {
                    // BotLog.Write(1, "FiveMinute", "Starting automated payout processing");
                    Payouts.PerformAutomated(BitcoinChain.Cash);
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }

                try
                {
                    /*BotLog.Write(1, "FiveMinute", "Starting newsletter checker");
                     * TestTrace("Running NewsletterChecker.Run()...");
                     * NewsletterChecker.Run();
                     * TestTrace(" done.\r\n");*/
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }

                try
                {
                    /*BotLog.Write(1, "FiveMinute", "Starting turnaround tracker");
                     * TestTrace("Running TurnaroundTracker.Run()...");
                     * TurnaroundTracker.Run();
                     * TestTrace(" done.\r\n");*/
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }

                try
                {
                    // TestTrace(" done.\r\nRunning UpdateStatsCache.Run()...");
                    // UpdateStatsCache.Run();

                    /*TestTrace(" done.\r\nRunning TranslateUrls()...");
                     * TranslateUrls();*/

                    // Added during election rush 2010: clean up support database every five minutes instead of once a day
                    // SMS notifications for bounces are turned off, so people don't get SMS notifications in the middle of the night
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }

                try
                {
                    /*BotLog.Write(1, "FiveMinute", "Closing delay warnings");
                     * TestTrace("Running SupportDatabase.CloseDelayWarnings()...");
                     * SupportDatabase.CloseDelayWarnings();
                     * TestTrace(" done.\r\n");*/
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }

                try
                {
                    /*TestTrace("Running SupportDatabase.NotifyBouncingEmails()...");
                     * BotLog.Write(1, "FiveMinute", "Notifying bouncing emails");
                     * SupportDatabase.NotifyBouncingEmails();
                     * TestTrace(" done.\r\n");*/
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }

                try
                {
                    /*TestTrace("Running SupportMailReview.Run()...");
                     * BotLog.Write(1, "FiveMinute", "Running support mail review");
                     * SupportMailReview.Run();
                     * TestTrace(" done.\r\n");*/
                }
                catch (Exception e)
                {
                    TraceAndReport(e);
                }


                BotLog.Write(0, "MainCycle", "Five-minute exit");
            }
            catch (Exception e)
            {
                ExceptionMail.Send(e, true);
                TestTrace(e.ToString());
            }
        }