fix: maintain lockstep with history file (#362)

This commit is contained in:
aclist 2026-07-27 22:11:48 +09:00
parent c97e34c336
commit 673038a1ab
3 changed files with 20 additions and 13 deletions

View File

@ -44,6 +44,7 @@
- Play offline (load mods directly)
- Generate Steam shortcuts and cover art
- Warn user if background downloads are disabled
- Dynamic copy button
### Changed
- Conform to PEP 440 versioning for beta versions
@ -63,6 +64,7 @@
- Propagate subscribed mods to Steam client
### Dropped
- Battlemetrics API support
- Debug mode
- Branch switching
- Manual mod install mode (describe rationale)
@ -73,6 +75,7 @@
- Center server title text on server dialogs
- Rare segfaults when changing maps (threading)
- Moved dialogs out of threads
- History table not being in lock-step with state file
### Unreleased
- Load offline mods

View File

@ -85,8 +85,8 @@ class ProxyModelManager:
if found is False:
self.control_model.append(history)
# if len(self.control_model) == 11:
# del self.control_model[0]
if len(self.control_model) == 11:
del self.control_model[0]
self.filter(FilterMode.INITIAL, skip_cache=True)

View File

@ -175,18 +175,22 @@ class ServerModelManager:
# TODO: wrap except
if self.controller.get_exit_event().is_set():
return
res = future.result(timeout=API_TIMEOUT)
self.thread_man.increment_dialog()
# NOTE: failing entries are culled
if res is None:
# TODO: log which servers failed
continue
servers.append(res)
if len(servers) == 0:
self.thread_man.set_cleanup_func(
StoredFunc(self._cleanup_on_failure), destroy_first=True
)
return
# NOTE: collects futures in linear order after completion
# for lock-step representation of the state file
for future in futures:
res = future.result(timeout=API_TIMEOUT)
# NOTE: failing entries are culled
if res is None:
# TODO: log which servers failed
continue
servers.append(res)
if len(servers) == 0:
self.thread_man.set_cleanup_func(
StoredFunc(self._cleanup_on_failure), destroy_first=True
)
return
parsed = Servers.parse_json(servers)
self._push_data(parsed)