コード例 #1
0
        private new JobExecution Add(JobHeader job)
        {
            JobExecution execution = new JobExecution
            {
                Identifier = Guid.NewGuid(),
                Job = job,
            };

            items.Add(execution);
            return execution;
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #4
0
ファイル: JobsModuleTests.cs プロジェクト: amacal/tick-tock
            private new JobHeader Add(JobData data)
            {
                JobHeader header = new JobHeader
                {
                    Identifier = Guid.NewGuid(),
                    Version = 1
                };

                items[header] = data;
                return header;
            }
コード例 #5
0
ファイル: JobsModuleTests.cs プロジェクト: amacal/tick-tock
 public void Job(JobHeader header, JobData data)
 {
     items[header] = data;
 }