ali.h
July 16, 2019, 10:38am
1
By below configuration option
.UseSqlServerStorage(connstring, new Hangfire.SqlServer.SqlServerStorageOptions()
{
SchemaName = “MNS”,
//CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.Zero,
//UseRecommendedIsolationLevel = true,
//UsePageLocksOnDequeue = true,
//DisableGlobalLocks = true,
}).UseConsole();
I will get the below exception :
System.ArgumentException: The QueuePollInterval property value should be positive. Given: 00:00:00.
Parameter name: value
at Hangfire.SqlServer.SqlServerStorageOptions.set_QueuePollInterval(TimeSpan value)
Any chance you are still using version 1.6.X? Zero-based queue poll intervals are supported only since version 1.7.
ali.h
July 17, 2019, 2:23pm
3
No,
I double checked the version, the version is 1.7.0, may VS lied to me or there is a conflict for my dlls,
see below screenshot:
Looks like there was a problem with your deployment, and the resulting environment still contains an old version.
Here’s the check in 1.6.X:
public IsolationLevel? TransactionIsolationLevel { get; set; }
public TimeSpan QueuePollInterval
{
get { return _queuePollInterval; }
set
{
var message = $"The QueuePollInterval property value should be positive. Given: {value}.";
if (value == TimeSpan.Zero)
{
throw new ArgumentException(message, nameof(value));
}
if (value != value.Duration())
{
throw new ArgumentException(message, nameof(value));
}
_queuePollInterval = value;
}
And the absence of the check in 1.7.X:
[Obsolete("TransactionIsolationLevel option is deprecated, please set UseRecommendedIsolationLevel instead. Will be removed in 2.0.0.")]
public IsolationLevel? TransactionIsolationLevel { get; set; }
public TimeSpan QueuePollInterval
{
get { return _queuePollInterval; }
set
{
var message = $"The QueuePollInterval property value should be positive. Given: {value}.";
if (value != value.Duration())
{
throw new ArgumentException(message, nameof(value));
}
_queuePollInterval = value;
}
}
[Obsolete("Does not make sense anymore. Background jobs re-queued instantly even after ungraceful shutdown now. Will be removed in 2.0.0.")]
public TimeSpan InvisibilityTimeout { get; set; }