ambon commited on
Commit
fc31fe4
·
verified ·
1 Parent(s): 1fa2e03

Update update.py

Browse files
Files changed (1) hide show
  1. update.py +7 -3
update.py CHANGED
@@ -11,8 +11,13 @@ import os
11
  enka_update = EnkaNetworkAPI()
12
 
13
  async def update_genshin():
14
- async with enka_update:
15
- await enka_update.update_assets(lang = ["EN"], path="/tmp")
 
 
 
 
 
16
 
17
  data_dir = "/tmp/data"
18
 
@@ -24,4 +29,3 @@ data_dir = "/tmp/langs"
24
  if not os.path.exists(data_dir):
25
  os.makedirs(data_dir)
26
  asyncio.run(update_genshin())
27
- print("Finished update")
 
11
  enka_update = EnkaNetworkAPI()
12
 
13
  async def update_genshin():
14
+ try:
15
+ async with enka_update:
16
+ await enka_update.update_assets(lang=["EN"], path="/tmp")
17
+ print("Finished update")
18
+ except Exception as e:
19
+ print(f"Update failed: {e}")
20
+
21
 
22
  data_dir = "/tmp/data"
23
 
 
29
  if not os.path.exists(data_dir):
30
  os.makedirs(data_dir)
31
  asyncio.run(update_genshin())