mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
bug-fixes
This commit is contained in:
parent
60b255c7ae
commit
07e4236701
1333 changed files with 198132 additions and 59228 deletions
6
dist/ba_root/mods/setting.py
vendored
6
dist/ba_root/mods/setting.py
vendored
|
|
@ -7,7 +7,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
from functools import lru_cache
|
||||
|
||||
import threading
|
||||
import json
|
||||
import _ba
|
||||
|
||||
|
|
@ -34,6 +34,8 @@ def get_settings_data() -> dict:
|
|||
# Handle the JSON decoding error (e.g., log it, raise an exception)
|
||||
print(f"Error decoding JSON: {e}")
|
||||
return {} # or handle it in a way that fits your application
|
||||
threading.Timer(20, get_settings_data).start()
|
||||
print("updated settings.json")
|
||||
|
||||
def refresh_cache() -> None:
|
||||
get_settings_data.cache_clear()
|
||||
|
|
@ -52,3 +54,5 @@ def commit(data: dict) -> None:
|
|||
json.dump(data, setting_file, indent=4)
|
||||
# settings updated ok now update the cache
|
||||
refresh_cache()
|
||||
|
||||
get_settings_data()
|
||||
Loading…
Add table
Add a link
Reference in a new issue