diff --git a/web/service/inbound.go b/web/service/inbound.go index 1450dd57..60530143 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -1037,8 +1037,12 @@ func (s *InboundService) disableInvalidInbounds(tx *gorm.DB) (bool, int64, error if err1 == nil { logger.Debug("Inbound disabled by api:", tag) } else { - logger.Debug("Error in disabling inbound by api:", err1) - needRestart = true + if strings.Contains(err1.Error(), fmt.Sprintf("User %s not found.", tag)) { + logger.Debug("User is already disabled. Nothing to do more...") + } else { + logger.Debug("Error in disabling client by api:", err1) + needRestart = true + } } } s.xrayApi.Close() @@ -1076,8 +1080,16 @@ func (s *InboundService) disableInvalidClients(tx *gorm.DB) (bool, int64, error) if err1 == nil { logger.Debug("Client disabled by api:", result.Email) } else { - logger.Debug("Error in disabling client by api:", err1) - needRestart = true + if strings.Contains(err1.Error(), fmt.Sprintf("User %s not found.", result.Email)) { + logger.Debug("User is already disabled. Nothing to do more...") + } else { + if strings.Contains(err1.Error(), fmt.Sprintf("User %s not found.", result.Email)) { + logger.Debug("User is already disabled. Nothing to do more...") + } else { + logger.Debug("Error in disabling client by api:", err1) + needRestart = true + } + } } } s.xrayApi.Close()