docs: align Hangfire dashboard guide with route (#369)
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and tests (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Publish versioned installer release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 2s
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and tests (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Publish versioned installer release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 2s
This commit is contained in:
1 parent
f20ec93f6f
commit
ea0e32cbe7
2 files changed
+11
-16
No files matched your search
+9
-16
@@ -15,7 +15,7 @@
|
|||||||
│ │
|
│ │
|
||||||
│ Hangfire Server │
|
│ Hangfire Server │
|
||||||
│ ├── Storage: PostgreSQL (Hangfire.PostgreSql) │
|
│ ├── Storage: PostgreSQL (Hangfire.PostgreSql) │
|
||||||
│ ├── Dashboard: /admin/jobs (authentifié, Admin only) │
|
│ ├── Dashboard: /hangfire (AdminJobs ou rôle Admin) │
|
||||||
│ └── Jobs: │
|
│ └── Jobs: │
|
||||||
│ ├── RetentionCheck (Recurring, daily) │
|
│ ├── RetentionCheck (Recurring, daily) │
|
||||||
│ ├── S3Cleanup (Recurring, daily) │
|
│ ├── S3Cleanup (Recurring, daily) │
|
||||||
@@ -467,27 +467,20 @@ public class HangfireInitializer : IHostedService
|
|||||||
|
|
||||||
Intégré à l'UI Admin, authentifié, pas exposé publiquement :
|
Intégré à l'UI Admin, authentifié, pas exposé publiquement :
|
||||||
|
|
||||||
|
La route Central est mappée par `MapHangfireDashboard("/hangfire", ...)` dans
|
||||||
|
`src/Heimdall.Web/Program.cs`. `HangfireAdminAuthorizationFilter` autorise les
|
||||||
|
requêtes authentifiées portant `Admin.Jobs` ou le rôle `Admin`. Le dashboard
|
||||||
|
n'est pas mappé dans l'environnement `Testing`.
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
// Heimdall.Api / Program.cs
|
// Heimdall.Web/Program.cs
|
||||||
app.UseHangfireDashboard("/admin/jobs", new DashboardOptions
|
app.MapHangfireDashboard("/hangfire", new DashboardOptions
|
||||||
{
|
{
|
||||||
Authorization =
|
Authorization =
|
||||||
[
|
[
|
||||||
new HangfireAuthorizationFilter() // vérifie AppPermissions.AdminJobs
|
new HangfireAdminAuthorizationFilter()
|
||||||
],
|
],
|
||||||
StatsPollingInterval = 3000, // 3s
|
|
||||||
DisplayStorageConnectionString = false,
|
|
||||||
DashboardTitle = "Heimdall — Jobs",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public class HangfireAuthorizationFilter : IDashboardAuthorizationFilter
|
|
||||||
{
|
|
||||||
public bool Authorize(DashboardContext context)
|
|
||||||
{
|
|
||||||
var httpContext = context.GetHttpContext();
|
|
||||||
return httpContext.User?.IsInRole(AppRoles.Admin) == true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ description: Diagnose and recover Heimdall startup from transient Hangfire Postg
|
|||||||
|
|
||||||
Heimdall registers all recurring jobs synchronously after database migrations in `src/Heimdall.Web/Program.cs`. Hangfire's PostgreSQL storage acquires a distributed lock per recurring-job id during `AddOrUpdate`; `agent-failover` is currently the first registration after removing the legacy `heartbeat-monitor` id.
|
Heimdall registers all recurring jobs synchronously after database migrations in `src/Heimdall.Web/Program.cs`. Hangfire's PostgreSQL storage acquires a distributed lock per recurring-job id during `AddOrUpdate`; `agent-failover` is currently the first registration after removing the legacy `heartbeat-monitor` id.
|
||||||
|
|
||||||
|
The Central dashboard route is mapped from the same Program.cs with `MapHangfireDashboard("/hangfire", ...)`, guarded by `HangfireAdminAuthorizationFilter` for `Admin.Jobs` or the Admin role, and omitted in `Testing`. When updating `docs/hangfire-usage.md`, verify the route and filter against these sources; do not copy a stale `UseHangfireDashboard` or `/admin/jobs` example.
|
||||||
|
|
||||||
## Implementation and diagnosis
|
## Implementation and diagnosis
|
||||||
|
|
||||||
- Inspect the GlitchTip event stack, app start time, event timestamps, and `Program.cs`/`JobSetup.cs` line references. A timeout names the contended job key; it proves lock contention, not the number or identity of competing processes.
|
- Inspect the GlitchTip event stack, app start time, event timestamps, and `Program.cs`/`JobSetup.cs` line references. A timeout names the contended job key; it proves lock contention, not the number or identity of competing processes.
|
||||||
|
|||||||
Reference in new issue
Block a user