fix: maintain lockstep with history file (#362)

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

No files matched your search

+3
View File
@@ -44,6 +44,7 @@
- Play offline (load mods directly) - Play offline (load mods directly)
- Generate Steam shortcuts and cover art - Generate Steam shortcuts and cover art
- Warn user if background downloads are disabled - Warn user if background downloads are disabled
- Dynamic copy button
### Changed ### Changed
- Conform to PEP 440 versioning for beta versions - Conform to PEP 440 versioning for beta versions
@@ -63,6 +64,7 @@
- Propagate subscribed mods to Steam client - Propagate subscribed mods to Steam client
### Dropped ### Dropped
- Battlemetrics API support
- Debug mode - Debug mode
- Branch switching - Branch switching
- Manual mod install mode (describe rationale) - Manual mod install mode (describe rationale)
@@ -73,6 +75,7 @@
- Center server title text on server dialogs - Center server title text on server dialogs
- Rare segfaults when changing maps (threading) - Rare segfaults when changing maps (threading)
- Moved dialogs out of threads - Moved dialogs out of threads
- History table not being in lock-step with state file
### Unreleased ### Unreleased
- Load offline mods - Load offline mods
+2 -2
View File
@@ -85,8 +85,8 @@ class ProxyModelManager:
if found is False: if found is False:
self.control_model.append(history) self.control_model.append(history)
# if len(self.control_model) == 11: if len(self.control_model) == 11:
# del self.control_model[0] del self.control_model[0]
self.filter(FilterMode.INITIAL, skip_cache=True) self.filter(FilterMode.INITIAL, skip_cache=True)
+15 -11
View File
@@ -175,18 +175,22 @@ class ServerModelManager:
# TODO: wrap except # TODO: wrap except
if self.controller.get_exit_event().is_set(): if self.controller.get_exit_event().is_set():
return return
res = future.result(timeout=API_TIMEOUT)
self.thread_man.increment_dialog() self.thread_man.increment_dialog()
# NOTE: failing entries are culled
if res is None: # NOTE: collects futures in linear order after completion
# TODO: log which servers failed # for lock-step representation of the state file
continue for future in futures:
servers.append(res) res = future.result(timeout=API_TIMEOUT)
if len(servers) == 0: # NOTE: failing entries are culled
self.thread_man.set_cleanup_func( if res is None:
StoredFunc(self._cleanup_on_failure), destroy_first=True # TODO: log which servers failed
) continue
return 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) parsed = Servers.parse_json(servers)
self._push_data(parsed) self._push_data(parsed)