public BackgroundJobServerOptions() { WorkerCount = Math.Min(Environment.ProcessorCount * 5, MaxDefaultWorkerCount); ServerName = Environment.MachineName; Queues = new[] { EnqueuedState.DefaultQueue }; ShutdownTimeout = TimeSpan.FromSeconds(15); SchedulePollingInterval = SchedulerResolution.Current.GetSchedulePollingInterval(); ServerWatchdogOptions = new ServerWatchdogOptions(); }
public ServerWatchdogFacts() { _storage = new Mock <JobStorage>(); _connection = new Mock <IStorageConnection>(); _options = new ServerWatchdogOptions { CheckInterval = Timeout.InfiniteTimeSpan // To check that it exits by cancellation token }; _token = new CancellationToken(true); _storage.Setup(x => x.GetConnection()).Returns(_connection.Object); }