/// <summary> /// ctor /// </summary> /// <param name="dbContext"></param> /// <param name="jobQueueSemaphore"></param> /// <param name="distributedLockMutex"></param> public MongoNotificationObserver(HangfireDbContext dbContext, IJobQueueSemaphore jobQueueSemaphore, IDistributedLockMutex distributedLockMutex) { _dbContext = dbContext; _jobQueueSemaphore = jobQueueSemaphore; _distributedLockMutex = distributedLockMutex; }
/// <summary> /// ctor /// </summary> /// <param name="dbContext"></param> /// <param name="storageOptions"></param> /// <param name="semaphore"></param> public MongoJobFetcher(HangfireDbContext dbContext, MongoStorageOptions storageOptions, IJobQueueSemaphore semaphore) { _storageOptions = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions)); _semaphore = semaphore; _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); }
#pragma warning disable 1591 public MongoConnection( HangfireDbContext database, MongoStorageOptions storageOptions, IJobQueueSemaphore jobQueueSemaphore) { _dbContext = database ?? throw new ArgumentNullException(nameof(database)); _storageOptions = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions)); _jobFetcher = new MongoJobFetcher(database, storageOptions, jobQueueSemaphore); }
public MongoJobFetcher(HangfireDbContext dbContext, MongoStorageOptions storageOptions, IJobQueueSemaphore semaphore) { _storageOptions = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions)); _semaphore = semaphore; _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); _invisibilityTimeout = DateTime.UtcNow.AddSeconds(_storageOptions.InvisibilityTimeout.Negate().TotalSeconds); }