Exemplo n.º 1
0
 public void Enqueue(ReportState state)
 {
     lock (Locker)
     {
         tasks.QueueTask(state.GenerateReport, state.GetDistributedTask());
     }
 }
Exemplo n.º 2
0
        public static ReportState Status(ReportOrigin origin)
        {
            lock (Locker)
            {
                var task = tasks.GetTasks().LastOrDefault(Predicate(origin));
                if (task == null)
                {
                    return(null);
                }

                var result = ReportState.FromTask(task);
                if ((int)result.Status > 1)
                {
                    tasks.RemoveTask(task.Id);
                }

                return(result);
            }
        }
Exemplo n.º 3
0
        public ReportState Status(ReportOrigin origin, IHttpContextAccessor httpContextAccessor, int tenantId, Guid userId)
        {
            lock (Locker)
            {
                var task = tasks.GetTasks().LastOrDefault(Predicate(origin, tenantId, userId));
                if (task == null)
                {
                    return(null);
                }

                var result = ReportState.FromTask(task, httpContextAccessor, tenantId, userId);
                var status = task.GetProperty <ReportStatus>("status");
                var id     = task.GetProperty <ReportStatus>("status");

                if ((int)status > 1)
                {
                    tasks.RemoveTask(task.Id);
                }

                return(result);
            }
        }
Exemplo n.º 4
0
 public void Enqueue(ReportState state)
 {
     DocbuilderReportsUtility.Enqueue(state);
 }