Add clear stuck jobs admin feature and simplify worker scheduling
- Add POST /api/admin/settings/clear-stuck-jobs endpoint to clear stuck/failed asynq worker jobs from Redis (retry queue, archived, orphaned task metadata) - Add "Clear Stuck Jobs" button to admin settings UI - Remove TASK_REMINDER_MINUTE config - all jobs now run at minute 0 - Simplify formatCron to only take hour parameter - Update default notification times to CST-friendly hours 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -80,7 +80,6 @@ type AppleAuthConfig struct {
|
||||
type WorkerConfig struct {
|
||||
// Scheduled job times (UTC)
|
||||
TaskReminderHour int
|
||||
TaskReminderMinute int
|
||||
OverdueReminderHour int
|
||||
DailyNotifHour int
|
||||
}
|
||||
@@ -173,7 +172,6 @@ func Load() (*Config, error) {
|
||||
},
|
||||
Worker: WorkerConfig{
|
||||
TaskReminderHour: viper.GetInt("TASK_REMINDER_HOUR"),
|
||||
TaskReminderMinute: viper.GetInt("TASK_REMINDER_MINUTE"),
|
||||
OverdueReminderHour: viper.GetInt("OVERDUE_REMINDER_HOUR"),
|
||||
DailyNotifHour: viper.GetInt("DAILY_DIGEST_HOUR"),
|
||||
},
|
||||
@@ -244,11 +242,10 @@ func setDefaults() {
|
||||
viper.SetDefault("APNS_USE_SANDBOX", true)
|
||||
viper.SetDefault("APNS_PRODUCTION", false)
|
||||
|
||||
// Worker defaults (all times in UTC)
|
||||
viper.SetDefault("TASK_REMINDER_HOUR", 20) // 8:00 PM UTC
|
||||
viper.SetDefault("TASK_REMINDER_MINUTE", 0)
|
||||
viper.SetDefault("OVERDUE_REMINDER_HOUR", 9) // 9:00 AM UTC
|
||||
viper.SetDefault("DAILY_DIGEST_HOUR", 11) // 11:00 AM UTC
|
||||
// Worker defaults (all times in UTC, jobs run at minute 0)
|
||||
viper.SetDefault("TASK_REMINDER_HOUR", 14) // 8:00 PM UTC
|
||||
viper.SetDefault("OVERDUE_REMINDER_HOUR", 15) // 9:00 AM UTC
|
||||
viper.SetDefault("DAILY_DIGEST_HOUR", 3) // 3:00 AM UTC
|
||||
|
||||
// Storage defaults
|
||||
viper.SetDefault("STORAGE_UPLOAD_DIR", "./uploads")
|
||||
|
||||
Reference in New Issue
Block a user