Soenneker.Hangfire.Redis.Util 11.0.384

Prefix Reserved
dotnet add package Soenneker.Hangfire.Redis.Util --version 11.0.384
                    
NuGet\Install-Package Soenneker.Hangfire.Redis.Util -Version 11.0.384
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Hangfire.Redis.Util" Version="11.0.384" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Hangfire.Redis.Util" Version="11.0.384" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Hangfire.Redis.Util" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Hangfire.Redis.Util --version 11.0.384
                    
#r "nuget: Soenneker.Hangfire.Redis.Util, 11.0.384"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Hangfire.Redis.Util@11.0.384
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Hangfire.Redis.Util&version=11.0.384
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Hangfire.Redis.Util&version=11.0.384
                    
Install as a Cake Tool

We recommend Flywheel for background jobs due to our concerns about Hangfire's approach to community collaboration and addressing security vulnerabilities.

These libraries will no longer receive new features. Dependencies will continue to be updated.

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Hangfire.Redis.Util

Provides destructive maintenance operations for removing Hangfire background-job data directly from Redis while preserving selected jobs and Hangfire infrastructure metadata.

Installation

dotnet add package Soenneker.Hangfire.Redis.Util

Configuration and registration

{
  "Redis": {
    "ConnectionString": "redis.example.com:6379,password=..."
  }
}
using Soenneker.Hangfire.Redis.Util.Registrars;

services.AddHangfireRedisUtilAsScoped();

The scoped utility uses the long-lived Redis connections registered by the underlying Redis packages; disposing the utility scope does not tear down the shared connection.

Delete jobs while preserving specific IDs

using Soenneker.Hangfire.Redis.Util.Abstract;

long deletedKeyCount = await redisUtil.DeleteAllJobsExcept(
    prefix: "{hangfire}:",
    preservedJobIds: [importantJobId, anotherJobId],
    batchSize: 500,
    cancellationToken);

The prefix must exactly match the prefix configured for Hangfire Redis storage, including its trailing separator. The method removes non-preserved job: and console: keys and removes non-preserved entries from succeeded, deleted, processing, failed, awaiting, scheduled, and queue indexes. Recurring-job definitions, queue metadata, locks, and server metadata are retained.

To remove every background job without preserving IDs:

await redisUtil.DeleteAllHangfireKeysSafe("{hangfire}:", cancellationToken);

“Safe” means Hangfire infrastructure metadata is retained; the operation still permanently deletes all job data. Stop or quiesce Hangfire workers before running either method. Cleanup spans multiple Redis keys and is not one atomic transaction, so cancellation or a Redis failure can leave a partially cleaned data set. Back up production Redis data and verify the prefix before use.

DeleteAllJobsExcept() returns only the number of per-job and console keys deleted; removed index entries are not included in that count.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.384 0 11/15/2026
11.0.383 48 11/13/2026
11.0.382 77 11/11/2026
11.0.381 76 11/11/2026
11.0.380 79 11/11/2026
11.0.379 83 11/11/2026
11.0.378 77 11/11/2026
11.0.377 80 11/11/2026
11.0.376 77 11/11/2026
11.0.375 87 11/3/2026
11.0.374 93 11/3/2026
11.0.373 91 11/3/2026
11.0.372 96 11/3/2026
11.0.371 93 11/3/2026
11.0.370 86 11/3/2026
11.0.369 95 11/3/2026
11.0.368 94 11/3/2026
11.0.367 96 11/2/2026
11.0.366 100 10/31/2026
11.0.365 101 10/29/2026
Loading failed

Update dependency Soenneker.Redis.Util.Server to 11.0.3223 (#634)