mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
fix(client): Add reason to unregistration to skip persistence
This commit is contained in:
@@ -346,7 +346,12 @@ func StartService(cfg *config.Config, configPath string) {
|
||||
for _, c := range snapshot {
|
||||
// Persist tokens/cookies then unregister/cleanup per client.
|
||||
_ = c.SaveTokenToFile()
|
||||
if u, ok := any(c).(interface{ UnregisterClient() }); ok {
|
||||
switch u := any(c).(type) {
|
||||
case interface {
|
||||
UnregisterClientWithReason(interfaces.UnregisterReason)
|
||||
}:
|
||||
u.UnregisterClientWithReason(interfaces.UnregisterReasonShutdown)
|
||||
case interface{ UnregisterClient() }:
|
||||
u.UnregisterClient()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user