Exemple #1
0
        public string Save(PersistentTask persistentTask)
        {
            using (var session = _documentStore.OpenSession())
            {
                persistentTask.CreateDate = DateTime.UtcNow;
                persistentTask.Status = PersistentTaskStatus.Pending;

                session.Store(persistentTask);
                session.SaveChanges();

                return persistentTask.Id;
            }
        }
Exemple #2
0
 private void MarkAs(PersistentTask task, IDocumentSession session, PersistentTaskStatus persistentTaskStatus)
 {
     task.Status = persistentTaskStatus;
     session.Store(task);
     session.SaveChanges();
 }
Exemple #3
0
 private void IncreaseRetryCount(IDocumentSession session, PersistentTask task)
 {
     task.RetryCount++;
     MarkAs(task, session, PersistentTaskStatus.Pending);
 }
Exemple #4
0
        private static string GetExecutorQualifiedName(PersistentTask task)
        {
            var qualifiedNameSplit = task.GetType().AssemblyQualifiedName.Split(',');
            qualifiedNameSplit[0] += "Executor";

            return String.Join(",", qualifiedNameSplit);
        }