Akane710 commited on
Commit
cfac740
·
verified ·
1 Parent(s): 59a08a8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -7
main.py CHANGED
@@ -142,16 +142,12 @@ def root():
142
  def root():
143
  return "خدتك عليه"
144
 
145
- async def update_assets() -> None:
146
- async with EnkaNetworkAPI() as client:
147
- await client.update_assets()
148
- await enka.ApiEnkaNetwork().update_assets()
149
-
150
  @app.get("/update")
151
  async def root():
152
  try:
153
- await update_assets() # Call the async function directly
154
- return JSONResponse(content={'response': 'Assets updated successfully'})
 
155
  except Exception as e:
156
  return JSONResponse(content={'error': 'UNKNOWN ERR: ' + str(e)}, status_code=500)
157
 
 
142
  def root():
143
  return "خدتك عليه"
144
 
 
 
 
 
 
145
  @app.get("/update")
146
  async def root():
147
  try:
148
+ # Update assets using encbanner
149
+ result = await encbanner.update() # Await the async update method
150
+ return JSONResponse(content={'response': 'Assets updated successfully', 'result': result})
151
  except Exception as e:
152
  return JSONResponse(content={'error': 'UNKNOWN ERR: ' + str(e)}, status_code=500)
153