private new JobExecution Add(JobHeader job)
        {
            JobExecution execution = new JobExecution
            {
                Identifier = Guid.NewGuid(),
                Job = job,
            };

            items.Add(execution);
            return execution;
        }
Example #2
0
        private static JobHeader AddOrUpdate(string location, Guid identifier, JobData data)
        {
            int version = 1;
            string name = identifier.ToHex();

            JobFileEntry[] info = GetInfo(location, x => x.Identifier == identifier);
            JobFileEntry current = info.FirstOrDefault();

            if (current != null)
                version = current.Version + 1;

            string path = Path.Combine(location, $"{name}-{version}");
            JobHeader header = new JobHeader
            {
                Identifier = identifier,
                Version = version
            };

            File.WriteAllText(path, JsonConvert.SerializeObject(data));
            return header;
        }
Example #3
0
        private static JobHeader AddOrUpdate(string location, Guid identifier, JobData data)
        {
            int    version = 1;
            string name    = identifier.ToHex();

            JobFileEntry[] info    = GetInfo(location, x => x.Identifier == identifier);
            JobFileEntry   current = info.FirstOrDefault();

            if (current != null)
            {
                version = current.Version + 1;
            }

            string    path   = Path.Combine(location, $"{name}-{version}");
            JobHeader header = new JobHeader
            {
                Identifier = identifier,
                Version    = version
            };

            File.WriteAllText(path, JsonConvert.SerializeObject(data));
            return(header);
        }
Example #4
0
            private new JobHeader Add(JobData data)
            {
                JobHeader header = new JobHeader
                {
                    Identifier = Guid.NewGuid(),
                    Version = 1
                };

                items[header] = data;
                return header;
            }
Example #5
0
 public void Job(JobHeader header, JobData data)
 {
     items[header] = data;
 }