mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 21:24:10 +00:00
refactor: simplify GetLastStatus nil check and failsafe condition per review
Agent-Logs-Url: https://github.com/xAlokyx/3x-ui/sessions/dd7a9d3c-fddb-4521-9fcf-26bb342d408c Co-authored-by: xAlokyx <234771438+xAlokyx@users.noreply.github.com>
This commit is contained in:
parent
159457d57b
commit
10fb9dfa29
2 changed files with 1 additions and 6 deletions
|
|
@ -114,9 +114,6 @@ func (a *ServerController) status(c *gin.Context) {
|
|||
func (a *ServerController) GetLastStatus() any {
|
||||
a.mu.RLock()
|
||||
defer a.mu.RUnlock()
|
||||
if a.lastStatus == nil {
|
||||
return nil
|
||||
}
|
||||
return a.lastStatus
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1139,9 +1139,7 @@
|
|||
// timeout of 6 seconds guarantees the loading screen always clears.
|
||||
await (async () => {
|
||||
const failsafeTimer = setTimeout(() => {
|
||||
if (!this.loadingStates.fetched) {
|
||||
this.loadingStates.fetched = true;
|
||||
}
|
||||
this.loadingStates.fetched = true;
|
||||
}, 6000);
|
||||
const maxRetries = 5;
|
||||
for (let i = 0; i < maxRetries; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue