protected void StartJob() { List <Database> publishingTargetDatabases = GetPublishingTargetDatabases(); if (publishingTargetDatabases.Any()) { Handle publishHandle = null; publishHandle = MultiSitesManager.PublishSites(publishingTargetDatabases); if (publishHandle != null) { this.JobHandle = publishHandle.ToString(); SheerResponse.Timer("CheckStatus", 400); } else { base.Active = "LastPage"; base.BackButton.Disabled = true; this.ResultText.Value = this.Status.Text = Translate.Text("Oops looks like something went wrong. Please try again or have a developer check the logs."); } } else { MultiSitesManager.Flush(); base.Active = "LastPage"; base.BackButton.Disabled = true; this.ResultText.Value = this.Status.Text = Translate.Text("Flushed"); } }
/// <summary> /// This method does the work for the event /// </summary> public virtual void OnFlushRemoteEvent(object sender, EventArgs args) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(args, "args"); var restartServer = ((FlushRemoteEventArgs)args).RestartServer; MultiSitesManager.Flush(); if (restartServer) { RestartServer(); } }