Example #1
0
        private static async Task SendSuccessMailInternal([NotNull] string description, [NotNull] string message, TimeSpan duration)
        {
            var    errors         = EventSourceRegistrar.GetSessionErrors();
            var    eventFormatter = new EventTextFormatter();
            string errorsText;

            using (var writer = new StringWriter())
            {
                foreach (var error in errors)
                {
                    eventFormatter.WriteEvent(error, writer);
                }
                errorsText = writer.ToString();
            }

            CommonEventSource.Log.SendSuccessMailStart(description);

            var from    = new EmailAddress("*****@*****.**", "HLTBS webjobs");
            var to      = new EmailAddress("*****@*****.**", "HLTBS contact");
            var subject = String.Format(CultureInfo.InvariantCulture, "{0} - Success ({1}) [{2}]",
                                        WebJobName, duration, message + (errors.Length == 0 ? String.Empty : " (with session errors)"));
            var text = String.Format(CultureInfo.InvariantCulture, "{1}{0}Run ID: {2}{0}Start time: {3}{0}End time:{4}{0}Output log file: {5}{6}",
                                     Environment.NewLine, GetTriggeredRunUrl(), WebJobRunId, DateTime.UtcNow - duration, DateTime.UtcNow, GetTriggeredLogUrl(),
                                     errors.Length == 0 ? String.Empty : String.Format("{0}Session Errors:{0}{1}", Environment.NewLine, errorsText));
            var mail = MailHelper.CreateSingleEmail(from, to, subject, text, null);

            using (var response = await SendGridClient.PostAsJsonAsync <SendGridMessage, string>(SendGridApiSendAddress, mail))
            {
                CommonEventSource.Log.SendSuccessMailStop(
                    description, response.ResponseMessage.StatusCode, response.ResponseMessage.Headers.ToString(), response.Content);
            }
        }
Example #2
0
        public static async void Cleanup()
        {
            await Task.Delay(2000); //give Azure Storage time to complete deletion of the suggestions

            await DrainAllSuggestionsForSteamApp();

            EventSourceRegistrar.DisposeEventListeners();
        }
Example #3
0
 private static void Main()
 {
     try
     {
         ProcessSuggestions().Wait();
         Console.WriteLine("Press [return] to terminate...");
         Console.ReadLine();
     }
     finally
     {
         EventSourceRegistrar.DisposeEventListeners();
     }
 }
 private static void Main()
 {
     try
     {
         SiteUtil.KeepWebJobAlive();
         SiteUtil.MockWebJobEnvironmentIfMissing("SuggestionWatcher");
         WatchForSuggestions().Wait();
     }
     finally
     {
         EventSourceRegistrar.DisposeEventListeners();
     }
 }
Example #5
0
 private static void Main()
 {
     EventSource.SetCurrentThreadActivityId(Guid.NewGuid());
     try
     {
         SiteUtil.KeepWebJobAlive();
         SiteUtil.MockWebJobEnvironmentIfMissing("HltbScraper");
         MainAsync().Wait();
     }
     finally
     {
         EventSourceRegistrar.DisposeEventListeners();
     }
 }
 private static void Main()
 {
     EventSource.SetCurrentThreadActivityId(Guid.NewGuid());
     try
     {
         SiteUtil.KeepWebJobAlive();
         SiteUtil.MockWebJobEnvironmentIfMissing("StorageBackupUploader");
         BackupTableStorage().Wait();
         DeleteOldLogEntries().Wait();
         DeleteOldBlobs().Wait();
     }
     finally
     {
         EventSourceRegistrar.DisposeEventListeners();
     }
 }
        private static void Main()
        {
            if (StorageHelper.AzureStorageTablesConnectionString.Contains("staging"))
            {
                Console.WriteLine("STAGING connection string detected - press any key to continue...");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("Non-staging connection string detected");
                Console.WriteLine("By proceeding, you might override PRODUCTION DATA");
                Console.Write("Are you absolutely sure? If so, type ABSOLUTELY SURE (in capital letters): ");
                var input = Console.ReadLine();
                if (input != "ABSOLUTELY SURE")
                {
                    Console.WriteLine("You are not absolutely sure, aborting");
                    return;
                }
            }

            try
            {
                //RebuildProcessedSuggestions();
                //ProcessIDarbSuggestions();
                //ProcessIDarbApps();
                //PrintGenres();
                //SerializeAllAppsToFile();
                //LoadAllAppsFromFile();
                //WriteAllMeasuredToTsv();
                //DeleteInvalidSuggestions();
                //InsertManualSuggestions();
                //DeleteUnknowns();
                ForceUpdateAppHltbId(409710, 1065);
                ForceUpdateAppHltbId(409720, 1066);
                //ForceUpdateAppHltbId(266310, 27913);
                //SendMail();
                //GetEarliestGame();
                Console.WriteLine("Done - Press any key to continue...");
                Console.ReadLine();
            }
            finally
            {
                EventSourceRegistrar.DisposeEventListeners();
            }
        }
 private static void Main()
 {
     EventSource.SetCurrentThreadActivityId(Guid.NewGuid());
     try
     {
         SiteUtil.KeepWebJobAlive();
         SiteUtil.MockWebJobEnvironmentIfMissing("MissingUpdater");
         SiteUtil.SetDefaultConnectionLimit();
         using (s_client = new HttpRetryClient(SteamApiRetries))
         {
             UpdateMissingGames().Wait();
         }
     }
     finally
     {
         EventSourceRegistrar.DisposeEventListeners();
     }
 }
Example #9
0
 private static void Main()
 {
     EventSource.SetCurrentThreadActivityId(Guid.NewGuid());
     try
     {
         SiteUtil.KeepWebJobAlive();
         SiteUtil.MockWebJobEnvironmentIfMissing("UnknownUpdater");
         SiteUtil.SetDefaultConnectionLimit();
         using (Client)
         {
             UpdateUnknownApps().Wait();
         }
     }
     finally
     {
         EventSourceRegistrar.DisposeEventListeners();
     }
 }
Example #10
0
 protected void Application_End(object sender, EventArgs e)
 {
     EventSourceRegistrar.DisposeEventListeners();
 }
Example #11
0
 public void Cleanup()
 {
     EventSourceRegistrar.DisposeEventListeners();
 }