private void UpdateSyncStatus(string webSiteName, SyncInstanceStatus status)
        {
            if (this.syncStatusRepository != null)
            {
                var syncStatus = new SyncStatus
                {
                    SiteName = webSiteName,
                    RoleInstanceId = RoleEnvironment.IsAvailable ? RoleEnvironment.CurrentRoleInstance.Id : Environment.MachineName,
                    Status = status,
                    IsOnline = true
                };

                this.syncStatusRepository.UpdateStatus(syncStatus);
            }
        }
        public void UpdateAllSitesSyncStatus(string roleInstanceId, bool isOnline)
        {
            SyncStatus newSyncStatus;

            foreach (var syncStatus in this.syncStatusRepository.RetrieveSyncStatusByInstanceId(roleInstanceId))
            {
                newSyncStatus = new SyncStatus
                {
                    SiteName = syncStatus.SiteName,
                    RoleInstanceId = roleInstanceId,
                    Status = syncStatus.Status,
                    IsOnline = isOnline
                };

                this.syncStatusRepository.UpdateStatus(newSyncStatus);
            }
        }