Fix SetGroupExpand race

This commit is contained in:
世界
2026-08-30 17:41:43 +08:00
parent 7f1a2bd2be
commit 9a96e63643
+2 -5
View File
@@ -679,14 +679,11 @@ func (s *StartedService) SelectOutbound(ctx context.Context, request *SelectOutb
func (s *StartedService) SetGroupExpand(ctx context.Context, request *SetGroupExpandRequest) (*emptypb.Empty, error) {
s.serviceAccess.RLock()
switch s.serviceStatus.Status {
case ServiceStatus_STARTING, ServiceStatus_STARTED:
default:
s.serviceAccess.RUnlock()
defer s.serviceAccess.RUnlock()
if s.serviceStatus.Status != ServiceStatus_STARTED {
return nil, os.ErrInvalid
}
boxService := s.instance
s.serviceAccess.RUnlock()
if boxService.cacheFile != nil {
err := boxService.cacheFile.StoreGroupExpand(request.GroupTag, request.IsExpand)
if err != nil {