public bool?Run(IDocumentSession openSession) { Initialize(openSession); try { Execute(); DocumentSession.SaveChanges(); TaskExecutor.StartExecuting(); return(true); } catch (ConcurrencyException e) { logger.ErrorException("Could not execute task " + GetType().Name, e); OnError(e); return(null); } catch (Exception e) { logger.ErrorException("Could not execute task " + GetType().Name, e); OnError(e); return(false); } finally { TaskExecutor.Discard(); } }
protected override void OnActionExecuted(ActionExecutedContext filterContext) { if (filterContext.IsChildAction) { return; } using (RavenSession) { if (filterContext.Exception != null) { return; } if (RavenSession != null) { RavenSession.SaveChanges(); } } TaskExecutor.StartExecuting(); }