mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-16 10:05:00 +03:00
fix(clients): bound the auto-renew interval at a century
An interval renewal turned the client's reset days into milliseconds with no bound, so a value that wraps int64 (a node reports it unchecked) sent the catch-up loop stepping through time for seconds per client while the traffic writer held the database. Intervals above 36500 days no longer renew, and every client write refuses them.
This commit is contained in:
@@ -86,6 +86,9 @@ func validateClientRenewal(client model.Client) error {
|
||||
if err := validateClientResetDay(client.ResetDay); err != nil {
|
||||
return err
|
||||
}
|
||||
if client.Reset > maxClientResetDays {
|
||||
return common.NewError("client reset must not exceed", maxClientResetDays, "days")
|
||||
}
|
||||
if client.ResetWeekday < 0 || client.ResetWeekday > 7 {
|
||||
return common.NewError("client resetWeekday must be between 0 and 7, got:", client.ResetWeekday)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user