/// <summary>
        /// Registers the hangfire queue.
        /// </summary>
        public static void AddHangfireQueue(
            this IServiceCollection services,
            string connectionString,
            ILoggerFactory loggerFactory)
        {
            services.AddHangfire
            (
                config =>
                {
                    var logProvider = new HangfireLogProvider(loggerFactory);

                    var storage = new PostgreSqlStorage
                    (
                        connectionString,
                        new PostgreSqlStorageOptions()
                        {
                            QueuePollInterval = TimeSpan.FromSeconds(1)
                        }
                    );

                    config
                        .UseLogProvider(logProvider)
                        .UseStorage(storage);
                }
            );
        }
        public ExpirationManager(PostgreSqlStorage storage,  PostgreSqlStorageOptions options, TimeSpan checkInterval)
        {
            if (storage == null) throw new ArgumentNullException("storage");
            if (options == null) throw new ArgumentNullException("options");

            _options = options;
            _storage = storage;
            _checkInterval = checkInterval;
        }
 public ExpirationManager(PostgreSqlStorage storage, PostgreSqlStorageOptions options)
     : this(storage, options, TimeSpan.FromHours(1))
 {
 }