Progress towards background work replacement, work getting new NetworkManager and HttpClient up and running

This commit is contained in:
2026-02-01 15:12:24 -06:00
parent ebc045019a
commit 3e4b25f0d4
9 changed files with 273 additions and 358 deletions

View File

@@ -164,15 +164,15 @@ class W3DHub
if Gosu.milliseconds >= @server_list_expire
@server_list_expire = Gosu.milliseconds + 30_000
Api.on_thread(:server_list, 2) do |list|
if list
Api.on_thread(:server_list, 2) do |result|
if result.okay?
@server_list_expire = Gosu.milliseconds + SERVER_LIST_UPDATE_INTERVAL # five minutes
Store.server_list_last_fetch = Gosu.milliseconds
Api::ServerListUpdater.instance.refresh_server_list(list)
Api::ServerListUpdater.instance.refresh_server_list(result.data)
BackgroundWorker.foreground_job(-> {}, ->(_) { States::Interface.instance&.update_server_browser(nil, :refresh_all) })
Store.main_thread_queue << -> { States::Interface.instance&.update_server_browser(nil, :refresh_all) }
end
end
end