コード例 #1
0
        protected virtual async Task Act(ISyncManager syncManager)
        {
            var progressMonitoring = MonitorProgress(syncManager);
            await syncManager.ForceFullSync();

            await progressMonitoring;
        }
コード例 #2
0
 public IObservable <Unit> Execute()
 => userDataSource.Current
 .FirstAsync()
 .SelectMany(createWorkspace)
 .SelectMany(updateDefaultWorkspace)
 .SelectMany(_ => syncManager.PushSync().LastAsync())
 .SelectMany(_ => syncManager.ForceFullSync().LastAsync())
 .SelectUnit();
コード例 #3
0
 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())));
 }
コード例 #4
0
        private async void onInteractorFactory(ISyncManager syncManager)
        {
            lastTimeUsageStorage.SetLogin(timeService.CurrentDateTime);

            await syncManager.ForceFullSync();

            onboardingStorage.SetIsNewUser(false);

            await navigationService.Navigate <MainTabBarViewModel>();
        }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
        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>();
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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());
            }));
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        protected override async Task Act(ISyncManager syncManager)
        {
            await syncManager.PullTimeEntries();

            await syncManager.ForceFullSync();
        }
コード例 #11
0
 public static void InitiateFullSync <T>(this ISyncManager syncManager, T _)
 {
     syncManager.ForceFullSync();
 }
コード例 #12
0
 public static void InitiateFullSync(this ISyncManager syncManager)
 {
     var _ = syncManager.ForceFullSync();
 }
コード例 #13
0
        private void onSyncManager(ISyncManager syncManager)
        {
            syncManager.ForceFullSync();

            navigationService.Navigate <MainTabBarViewModel>();
        }
コード例 #14
0
ファイル: MainViewModel.cs プロジェクト: xleon/mobileapp
 private async Task refresh()
 {
     await syncManager.ForceFullSync();
 }