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); }
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); }
public JobCount Add(JobCount other) { return(new JobCount(Create + other.Create, Update + other.Update, Delete + other.Delete)); }