Exemple #1
0
        public IEnumerable <JobExecutionRecord> FindHistory(string nodeName, string jobKey)
        {
            var id = ScheduledRunHistory.ToId(nodeName, jobKey);

            using (var session = _store.OpenSession())
            {
                var history = session.Load <ScheduledRunHistory>(id);
                return(history == null ? new JobExecutionRecord[0] : history.Records.ToArray());
            }
        }
Exemple #2
0
        public void RecordHistory(string nodeName, string jobKey, JobExecutionRecord record)
        {
            var id = ScheduledRunHistory.ToId(nodeName, jobKey);

            _transaction.Execute <IDocumentSession>(session => {
                var history = session.Load <ScheduledRunHistory>(id)
                              ?? new ScheduledRunHistory {
                    JobKey = jobKey, NodeName = nodeName
                };

                history.Append(record, _maxHistory);
                session.Store(history);
            });
        }