/// <summary> /// /// </summary> /// <param name="connection"></param> /// <param name="storageOptions"></param> public LiteDbJobQueue(HangfireDbContext connection, LiteDbStorageOptions storageOptions) { _storageOptions = storageOptions ?? throw new ArgumentNullException(nameof(storageOptions)); _connection = connection ?? throw new ArgumentNullException(nameof(connection)); }
/// <summary> /// Opens connection to database /// </summary> /// <returns>Database context</returns> public HangfireDbContext CreateAndOpenConnection() { return(_connectionString != null ? HangfireDbContext.Instance(_connectionString, _storageOptions.Prefix) : null); }
/// <summary> /// Ctor using default storage options /// </summary> public LiteDbConnection(HangfireDbContext database, PersistentJobQueueProviderCollection queueProviders) : this(database, new LiteDbStorageOptions(), queueProviders) { }
/// <summary> /// </summary> /// <param name="connection"></param> /// <param name="queueProviders"></param> /// <exception cref="ArgumentNullException"></exception> public LiteDbWriteOnlyTransaction(HangfireDbContext connection, PersistentJobQueueProviderCollection queueProviders) { _connection = connection ?? throw new ArgumentNullException(nameof(connection)); _queueProviders = queueProviders ?? throw new ArgumentNullException(nameof(queueProviders)); }
/// <summary> /// /// </summary> /// <param name="connection"></param> public LiteDbJobQueueMonitoringApi(HangfireDbContext connection) { _connection = connection ?? throw new ArgumentNullException(nameof(connection)); }
/// <summary> /// /// </summary> /// <param name="connection"></param> /// <returns></returns> public IPersistentJobQueueMonitoringApi GetJobQueueMonitoringApi(HangfireDbContext connection) { return(new LiteDbJobQueueMonitoringApi(connection)); }
/// <summary> /// /// </summary> /// <param name="connection"></param> /// <returns></returns> public IPersistentJobQueue GetJobQueue(HangfireDbContext connection) { return(new LiteDbJobQueue(connection, _storageOptions)); }
private long GetNumberOfJobsByStateName(HangfireDbContext connection, string stateName) { var count = connection.Job.Count(_ => _.StateName == stateName); return(count); }
/// <summary> /// /// </summary> /// <param name="database"></param> /// <param name="queueProviders"></param> public LiteDbMonitoringApi(HangfireDbContext database, PersistentJobQueueProviderCollection queueProviders) { _database = database; _queueProviders = queueProviders; }
private long GetNumberOfJobsByStateName(HangfireDbContext connection, string stateName) { var count = connection.Job.Count(Query.EQ("StateName", stateName)); return(count); }