Beispiel #1
0
        private async Task EnsureSyncJobItems(string targetId, CancellationToken cancellationToken)
        {
            var jobResult = _syncRepo.GetJobs(new SyncJobQuery
            {
                SyncNewContent = true,
                TargetId       = targetId
            });

            foreach (var job in jobResult.Items)
            {
                cancellationToken.ThrowIfCancellationRequested();

                if (job.SyncNewContent)
                {
                    var user = _userManager.GetUserById(job.UserId);

                    if (user == null)
                    {
                        await _syncManager.CancelJob(job.Id).ConfigureAwait(false);
                    }
                    else
                    {
                        await EnsureJobItems(job, user).ConfigureAwait(false);
                    }
                }
            }
        }
Beispiel #2
0
        public QueryResult <SyncJob> GetJobs(SyncJobQuery query)
        {
            var result = _repo.GetJobs(query);

            result.Items.ForEach(FillMetadata);

            return(result);
        }
Beispiel #3
0
        public async Task <QueryResult <SyncJob> > GetJobs(SyncJobQuery query)
        {
            var result = _repo.GetJobs(query);

            foreach (var item in result.Items)
            {
                await FillMetadata(item).ConfigureAwait(false);
            }

            return(result);
        }
        public async Task EnsureSyncJobs(CancellationToken cancellationToken)
        {
            var jobResult = _syncRepo.GetJobs(new SyncJobQuery
            {
                IsCompleted = false
            });

            foreach (var job in jobResult.Items)
            {
                cancellationToken.ThrowIfCancellationRequested();

                if (job.SyncNewContent)
                {
                    await EnsureJobItems(job).ConfigureAwait(false);
                }
            }
        }
Beispiel #5
0
        private async Task EnsureSyncJobItems(string targetId, CancellationToken cancellationToken)
        {
            var jobResult = _syncRepo.GetJobs(new SyncJobQuery
            {
                SyncNewContent = true,
                TargetId       = targetId
            });

            foreach (var job in jobResult.Items)
            {
                cancellationToken.ThrowIfCancellationRequested();

                if (job.SyncNewContent)
                {
                    await EnsureJobItems(job).ConfigureAwait(false);
                }
            }
        }