public async Task UpdateStatus(string message, States newState, TraceLevel traceLevel) { this.Message = message; if (newState != States.Unknown) { this.State = newState; } await AccountStatus.UpdateAccountStatus(this); switch (traceLevel) { case TraceLevel.Error: DashTrace.TraceError(message); break; case TraceLevel.Warning: DashTrace.TraceWarning(message); break; case TraceLevel.Info: case TraceLevel.Verbose: DashTrace.TraceInformation(message); break; } }
static DashConfigurationSource() { _dataAccounts = new Lazy <IList <CloudStorageAccount> >(() => GetDataStorageAccountsFromConfig().ToList(), LazyThreadSafetyMode.PublicationOnly); _dataAccountsByName = new Lazy <IDictionary <string, CloudStorageAccount> >(() => DashConfiguration.DataAccounts .Where(account => account != null) .ToDictionary(account => account.Credentials.AccountName, StringComparer.OrdinalIgnoreCase), LazyThreadSafetyMode.PublicationOnly); _namespaceAccount = new Lazy <CloudStorageAccount>(() => { CloudStorageAccount account; string connectString = AzureUtils.GetConfigSetting("StorageConnectionStringMaster", ""); if (!CloudStorageAccount.TryParse(connectString, out account)) { DashTrace.TraceError("Error reading namespace account connection string from configuration. Details: {0}", connectString); return(null); } ServicePointManager.FindServicePoint(account.BlobEndpoint).ConnectionLimit = int.MaxValue; return(account); }, LazyThreadSafetyMode.PublicationOnly); }