bug-fixes

This commit is contained in:
Ubuntu 2024-03-31 13:34:28 +05:30
parent 60b255c7ae
commit 07e4236701
1333 changed files with 198132 additions and 59228 deletions

View file

@ -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()