Exemplo n.º 1
0
 public async Task UpdateStatus(Guid taskId, TaskStatus taskStatus, QueueStatus queueStatus)
 {
     await Collection().FindOneAndUpdateAsync(t => t.TaskId == taskId,
                                              Update
                                              .Set(t => t.QueueStatus, queueStatus)
                                              .Set(t => t.TaskStatus, taskStatus));
 }
Exemplo n.º 2
0
 public async Task FinishTask(Guid taskId, TaskStatus taskStatus, string writeLogs = null)
 {
     if (writeLogs != null)
     {
         await Collection().FindOneAndUpdateAsync(t => t.TaskId == taskId, Update
                                                  .Set(t => t.TaskStatus, taskStatus)
                                                  .Set(t => t.QueueStatus, QueueStatus.Completed)
                                                  .Set(t => t.Logs, writeLogs));
     }
     else
     {
         await Collection().FindOneAndUpdateAsync(t => t.TaskId == taskId, Update
                                                  .Set(t => t.TaskStatus, taskStatus)
                                                  .Set(t => t.QueueStatus, QueueStatus.Completed));
     }
 }
Exemplo n.º 3
0
 public async Task <NextPipeTask> SetTaskStartedWithMetadata <T>(Guid taskId, QueueStatus queueStatus, TaskStatus taskStatus, T metadata) where T : BaseMetadata
 {
     return(await Collection().FindOneAndUpdateAsync(t => t.TaskId == taskId, Update
                                                     .Set(t => t.QueueStatus, queueStatus)
                                                     .Set(t => t.TaskStatus, taskStatus)
                                                     .Set(t => t.Metadata, metadata)));
 }
Exemplo n.º 4
0
 public async Task <NextPipeTask> SetTaskStarted(Guid taskId, QueueStatus queueStatus, TaskStatus taskStatus)
 {
     return(await Collection().FindOneAndUpdateAsync(t => t.TaskId == taskId, Update
                                                     .Set(t => t.QueueStatus, queueStatus)
                                                     .Set(t => t.TaskStatus, taskStatus)));
 }