Skip to content

Commit

Permalink
AAAA
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Mar 10, 2024
1 parent cead164 commit ef70033
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions css_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
async def fetch_class_mappings(css_translations_path : str):
global SUCCESSFUL_FETCH_THIS_RUN

if (SUCCESSFUL_FETCH_THIS_RUN):
if SUCCESSFUL_FETCH_THIS_RUN:
return

setting = store_read("beta_translations")
Expand All @@ -34,13 +34,13 @@ async def fetch_class_mappings(css_translations_path : str):

async def every(__seconds: float, func, *args, **kwargs):
while True:
await func(*args, **kwargs)
await asyncio.sleep(__seconds)
await func(*args, **kwargs)

async def initialize_class_mappings():
css_translations_path = os.path.join(get_theme_path(), "css_translations.json")

asyncio.get_event_loop().create_task(every(60, fetch_class_mappings, css_translations_path))
asyncio.get_event_loop().create_task(every(120, fetch_class_mappings, css_translations_path))

if not os.path.exists(css_translations_path):
Log("Failed to get css translations from local file")
Expand Down

0 comments on commit ef70033

Please sign in to comment.