feat: 优雅退出

This commit is contained in:
tbphp
2025-07-13 20:55:32 +08:00
parent 99fd68d08f
commit ae751eb48a
8 changed files with 142 additions and 54 deletions

View File

@@ -1,6 +1,7 @@
package services
import (
"context"
"fmt"
"gpt-load/internal/config"
"gpt-load/internal/models"
@@ -93,7 +94,7 @@ func (gm *GroupManager) Invalidate() error {
}
// Stop gracefully stops the GroupManager's background syncer.
func (gm *GroupManager) Stop() {
func (gm *GroupManager) Stop(ctx context.Context) {
if gm.syncer != nil {
gm.syncer.Stop()
}