We are getting the following.
Error converting value “5d572c69d8e0ee54d8e8a87b” to type ‘MongoDB.Bson.ObjectId’
services.AddHangfire(globalConfiguration =>
{
var connectionString = _configuration[“redis:connectionString”];
var serializerSettings = new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};
serializerSettings.Converters.Add(new BsonDataObjectIdConverter());
globalConfiguration.UseSerializerSettings(serializerSettings);
var redisStorageOptions = new RedisStorageOptions
{
Database = _configuration.GetValue<int?>("redis:database") ?? 0
};
globalConfiguration.UseRedisStorage(connectionString, redisStorageOptions);
globalConfiguration.UseBatches();
globalConfiguration.UseLogProvider(new SerilogLogProvider());
globalConfiguration.UseFilter(new AutomaticRetryAttribute {LogEvents = false});
globalConfiguration.UseFilter(new FaildLoggingAttribute());
});