protected virtual async Task Act(ISyncManager syncManager) { var progressMonitoring = MonitorProgress(syncManager); await syncManager.ForceFullSync(); await progressMonitoring; }
public IObservable <Unit> Execute() => userDataSource.Current .FirstAsync() .SelectMany(createWorkspace) .SelectMany(updateDefaultWorkspace) .SelectMany(_ => syncManager.PushSync().LastAsync()) .SelectMany(_ => syncManager.ForceFullSync().LastAsync()) .SelectUnit();
public IObservable <SyncOutcome> Execute() { analyticsService.BackgroundSyncStarted.Track(); return(syncManager.ForceFullSync() .LastAsync() .Select(_ => SyncOutcome.NewData) .Catch((Exception error) => syncFailed(error)) .Do(outcome => analyticsService.BackgroundSyncFinished.Track(outcome.ToString()))); }
private async void onInteractorFactory(ISyncManager syncManager) { lastTimeUsageStorage.SetLogin(timeService.CurrentDateTime); await syncManager.ForceFullSync(); onboardingStorage.SetIsNewUser(false); await navigationService.Navigate <MainTabBarViewModel>(); }
private async Task tryAgain() { var anyWorkspaceIsAvailable = await syncManager.ForceFullSync() .Where(state => state == SyncState.Sleep) .SelectMany(_ => interactorFactory.GetAllWorkspaces().Execute()) .Any(workspaces => workspaces.Any()); if (anyWorkspaceIsAvailable) { Close(); } }
private async void onInteractorFactory(ISyncManager syncManager) { successfulSignupSubject.OnNext(Unit.Default); lastTimeUsageStorage.SetLogin(timeService.CurrentDateTime); await syncManager.ForceFullSync(); onboardingStorage.SetIsNewUser(true); onboardingStorage.SetUserSignedUp(); await navigationService.Navigate <MainTabBarViewModel>(); }
public void Start(ISyncManager syncManager) { Stop(); backgroundService.AppResumedFromBackground .Where(timeInBackground => timeInBackground >= MinimumTimeInBackgroundForFullSync) .SelectMany(_ => syncManager.ForceFullSync()) .Subscribe() .DisposedBy(syncingDisposeBag); timeService.MidnightObservable .Subscribe(_ => syncManager.CleanUp()) .DisposedBy(syncingDisposeBag); }
public IObservable <SyncOutcome> Execute() { var syncTimeStopwatch = stopwatchProvider.Create(MeasuredOperation.BackgroundSync); syncTimeStopwatch.Start(); analyticsService.BackgroundSyncStarted.Track(); return(syncManager.ForceFullSync() .LastAsync() .Select(_ => SyncOutcome.NewData) .Catch((Exception error) => syncFailed(error)) .Do(outcome => { syncTimeStopwatch.Stop(); analyticsService.BackgroundSyncFinished.Track(outcome.ToString()); })); }
private async void sync(ISyncManager syncManager, ITimeEntriesSource timeEntries) { var numberOfSyncedTimeEntries = 0; // To ignore time entries created/updated in the app it is enough to filter out all the ones which need sync. // There is still a problem with the entities which are created in the app and are immediately pushed // during the initial sync. I think it's OK to include these for the time being and re-evaluate this // decision once we collect some data. var subscription = Observable.Merge( timeEntries.Created.Where(timeEntry => timeEntry.SyncStatus == SyncStatus.InSync).SelectUnit(), timeEntries.Updated.Where(update => update.Entity.SyncStatus == SyncStatus.InSync).SelectUnit(), timeEntries.Deleted.SelectUnit()) .Subscribe(_ => numberOfSyncedTimeEntries++); await syncManager.ForceFullSync(); subscription.Dispose(); analyticsService.NumberOfSyncedTimeEntriesWhenResumingTheAppFromBackground.Track(numberOfSyncedTimeEntries); }
protected override async Task Act(ISyncManager syncManager) { await syncManager.PullTimeEntries(); await syncManager.ForceFullSync(); }
public static void InitiateFullSync <T>(this ISyncManager syncManager, T _) { syncManager.ForceFullSync(); }
public static void InitiateFullSync(this ISyncManager syncManager) { var _ = syncManager.ForceFullSync(); }
private void onSyncManager(ISyncManager syncManager) { syncManager.ForceFullSync(); navigationService.Navigate <MainTabBarViewModel>(); }
private async Task refresh() { await syncManager.ForceFullSync(); }