实现定时通道过期清理

This commit is contained in:
2026-05-07 14:58:11 +08:00
parent 8fc1d30578
commit a0b0be2b8e
10 changed files with 112 additions and 32 deletions

View File

@@ -49,3 +49,11 @@ func HandleRemoveChannel(_ context.Context, task *asynq.Task) (err error) {
}
return nil
}
func HandleClearExpiredChannels(_ context.Context, _ *asynq.Task) (err error) {
err = s.Channel.ClearExpiredChannels()
if err != nil {
return fmt.Errorf("清理过期通道失败: %w", err)
}
return nil
}