Ejemplo n.º 1
0
        /// <summary>
        /// Called by the QuartzScheduler before the <see cref="T:Quartz.Spi.IJobStore"/> is
        ///             used, in order to give the it a chance to Initialize.
        /// here we default triggerLockTime out to 5 mins (number in miliseconds)
        /// default redisLockTimeout to 5 secs (number in miliseconds)
        /// </summary>
        public Task Initialize(ITypeLoadHelper loadHelper, ISchedulerSignaler signaler, CancellationToken cancellationToken = default(CancellationToken))
        {
            _storeSchema = new RedisJobStoreSchema(KeyPrefix ?? string.Empty, KeyDelimiter ?? ":");
            _db          = ConnectionMultiplexer.Connect(RedisConfiguration).GetDatabase(0);
            _storage     = new RedisStorage(_storeSchema, _db, signaler, InstanceId, TriggerLockTimeout ?? 300000, RedisLockTimeout ?? 5000);

            return(Task.FromResult(0));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Called by the QuartzScheduler before the <see cref="T:Quartz.Spi.IJobStore"/> is
 ///             used, in order to give the it a chance to Initialize.
 /// here we default triggerLockTime out to 5 mins (number in miliseconds)
 /// default redisLockTimeout to 5 secs (number in miliseconds)
 /// </summary>
 public void Initialize(ITypeLoadHelper loadHelper, ISchedulerSignaler signaler)
 {
     _storeSchema = new RedisJobStoreSchema(KeyPrefix ?? string.Empty, KeyDelimiter ?? ":");
     _db          = ConnectionMultiplexer.Connect(RedisConfiguration).GetDatabase();
     _storage     = new RedisStorage(_storeSchema, _db, signaler, InstanceId, TriggerLockTimeout ?? 300000, RedisLockTimeout ?? 5000);
 }