Ejemplo n.º 1
0
        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
                });
            }
        }
Ejemplo n.º 2
0
        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);
        }