[PR #5363] [MERGED] fix(web): recover panicking cron jobs instead of crashing the panel #5859

Closed
opened 2026-11-02 04:04:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5363
Author: @n0ctal
Created: 6/15/2026
Status: ✅ Merged
Merged: 6/19/2026
Merged by: @MHSanaei

Base: main ← Head: pr-bug3-cron-recover


📝 Commits (1)

  • 9e8ca68 fix(web): recover panicking cron jobs instead of crashing the panel

📊 Changes

1 file changed (+9 additions, -1 deletions)

View changed files

📝 internal/web/web.go (+9 -1)

📄 Description

Summary

Wraps scheduled jobs with cron.Recover so a panicking job no longer crashes the panel.

Why

The scheduler was created without a panic-recovery wrapper, so a panic in any scheduled job (traffic write, IP check, etc.) propagated up and could take down the whole panel process.

Scope

  • adds cron.WithChain(cron.Recover(...)) with a small logger adapter
  • a panicking job is now logged and the scheduler keeps running
  • no change to job logic or scheduling

Validation

  • go build / go vet clean

Risk

Low. Adds resilience only; no functional change to jobs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5363 **Author:** [@n0ctal](https://github.com/n0ctal) **Created:** 6/15/2026 **Status:** ✅ Merged **Merged:** 6/19/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `pr-bug3-cron-recover` --- ### 📝 Commits (1) - [`9e8ca68`](https://github.com/MHSanaei/3x-ui/commit/9e8ca68dd8bdd25a47b33e956f5ef9d138e215a7) fix(web): recover panicking cron jobs instead of crashing the panel ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `internal/web/web.go` (+9 -1) </details> ### 📄 Description ## Summary Wraps scheduled jobs with `cron.Recover` so a panicking job no longer crashes the panel. ## Why The scheduler was created without a panic-recovery wrapper, so a panic in any scheduled job (traffic write, IP check, etc.) propagated up and could take down the whole panel process. ## Scope - adds `cron.WithChain(cron.Recover(...))` with a small logger adapter - a panicking job is now logged and the scheduler keeps running - no change to job logic or scheduling ## Validation - `go build` / `go vet` clean ## Risk Low. Adds resilience only; no functional change to jobs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5859
No description provided.