Пример #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;
            }
        }
Пример #2
0
 private void MarkAs(PersistentTask task, IDocumentSession session, PersistentTaskStatus persistentTaskStatus)
 {
     task.Status = persistentTaskStatus;
     session.Store(task);
     session.SaveChanges();
 }
Пример #3
0
 private void IncreaseRetryCount(IDocumentSession session, PersistentTask task)
 {
     task.RetryCount++;
     MarkAs(task, session, PersistentTaskStatus.Pending);
 }
Пример #4
0
        private static string GetExecutorQualifiedName(PersistentTask task)
        {
            var qualifiedNameSplit = task.GetType().AssemblyQualifiedName.Split(',');
            qualifiedNameSplit[0] += "Executor";

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