Esempio n. 1
0
            private void InitializeCount(ImpactActionEnum jobType, int?maxCount = null)
            {
                JobCount count = new JobCount()
                {
                    ActiveCount = 0,
                    MaxCount    = maxCount.HasValue ? maxCount.Value : GetMaxCountFromConfig(jobType),
                };

                map.Add(jobType, count);
            }
Esempio n. 2
0
            public bool CanAddActiveJob(ITenantJob job, out JobCount count)
            {
                var jobType = job.GetImpactAction();

                if (map.TryGetValue(jobType, out count) && (count.ActiveCount < count.MaxCount))
                {
                    return(true);
                }

                return(false);
            }
Esempio n. 3
0
 public JobCount Add(JobCount other)
 {
     return(new JobCount(Create + other.Create, Update + other.Update, Delete + other.Delete));
 }