подписка
This commit is contained in:
@@ -7,6 +7,7 @@ using Tnsu.ApprovalRoute.Application.Common.Errors;
|
||||
using Tnsu.ApprovalRoute.Domain.Entities;
|
||||
using Tnsu.ApprovalRoute.Infrastructure.Persistence;
|
||||
using Tnsu.ApprovalRoute.Infrastructure.SharePoint;
|
||||
using Tnsu.ApprovalRoute.Infrastructure.TnsuPortal;
|
||||
|
||||
namespace Tnsu.ApprovalRoute.Application.ListPartitioning;
|
||||
|
||||
@@ -19,6 +20,7 @@ public sealed class ListPartitionService(
|
||||
ISharePointClient sharePoint,
|
||||
ListPartitionRegistry registry,
|
||||
IBackgroundJobClient backgroundJobs,
|
||||
TnsuPortalCallerToken callerToken,
|
||||
IOptions<ListPartitioningOptions> options,
|
||||
ILogger<ListPartitionService> logger)
|
||||
{
|
||||
@@ -151,8 +153,12 @@ public sealed class ListPartitionService(
|
||||
// самой задачи (см. CreateNextListPartitionJob).
|
||||
if (requestType.ListPartitioningStartedAt is not null) return false;
|
||||
|
||||
// Токен ЭТОГО запроса уезжает в задачу: подписать новый список на
|
||||
// уведомления нужно от имени пользователя, а своего токена у фоновой задачи
|
||||
// нет (см. CreateNextListPartitionJob.RunAsync — там же про его хранение и
|
||||
// срок жизни).
|
||||
backgroundJobs.Enqueue<CreateNextListPartitionJob>(
|
||||
job => job.RunAsync(requestType.Id, CancellationToken.None));
|
||||
job => job.RunAsync(requestType.Id, callerToken.Current, CancellationToken.None));
|
||||
|
||||
logger.LogInformation(
|
||||
"В списке {ListId} типа заявок {RequestTypeId} {ItemCount} элементов (порог {Threshold}) — " +
|
||||
|
||||
Reference in New Issue
Block a user