public async Task <int> CountRunningJobsAsync(bool isSync) { var runningCount = isSync ? jobDAL.CountRunningJobs(workerProcessID) : await jobDAL.CountRunningJobsAsync(workerProcessID); return(runningCount); }