public async Task <IActionResult> UpdateMobileData() { try { logger.LogInformation("Realm to update {RealmServerUrl}/{RealmName}", realmSettings.RealmServerUrl, realmSettings.RealmName); var user = await this.GetUser(); var realmUrl = new Uri($"realms://{realmSettings.RealmServerUrl}/{realmSettings.RealmName}"); var realm = await GetRealm(realmUrl, user); var currentVersion = GetCurrentVersion(realm); var auditUpdate = await UpdateManager.GetAuditUpdate(currentVersion, logger); realm = await GetRealm(realmUrl, user); DotNetRuRealmHelper.UpdateRealm(realm, auditUpdate); await SendMeetupsNotifications(auditUpdate); return(new OkObjectResult(realmSettings)); } catch (Exception e) { logger.LogCritical(e, "Unhandled error while updating realm"); return(new ObjectResult(e) { StatusCode = StatusCodes.Status500InternalServerError }); } }
private async Task UpdateOnlineRealm() { var user = await this.GetUser(); var realmUrl = new Uri($"realms://{realmSettings.RealmServerUrl}/{realmSettings.RealmName}"); var realm = await GetRealm(realmUrl, user); var currentVersion = GetCurrentVersion(realm); var auditUpdate = await UpdateManager.GetAuditUpdate(currentVersion, logger); DotNetRuRealmHelper.UpdateRealm(realm, auditUpdate); await SendMeetupsNotifications(auditUpdate); }