privateone commited on
Commit
720e407
·
1 Parent(s): 39310fa

Code Updates & Optimisations :Server Upgrade Test

Browse files
Files changed (1) hide show
  1. FileStream/__main__.py +3 -2
FileStream/__main__.py CHANGED
@@ -29,6 +29,9 @@ logging.getLogger("aiohttp").setLevel(logging.ERROR)
29
  logging.getLogger("pyrogram").setLevel(logging.ERROR)
30
  logging.getLogger("aiohttp.web").setLevel(logging.ERROR)
31
 
 
 
 
32
  async def start_services():
33
  print(
34
  "****\n"
@@ -52,7 +55,6 @@ async def start_services():
52
  print("------------------------------ DONE ------------------------------\n\n")
53
 
54
  print("--------------------- Initializing Web Server ---------------------")
55
- server = web.AppRunner(web_server()) # Initialize the app runner
56
  await server.setup() # Setup the web server
57
  await web.TCPSite(server, Server.BIND_ADDRESS, Server.PORT).start()
58
  print("------------------------------ DONE ------------------------------\n\n")
@@ -77,7 +79,6 @@ async def cleanup():
77
 
78
  if __name__ == "__main__":
79
  try:
80
- loop = asyncio.get_event_loop() # Ensure the event loop is retrieved correctly
81
  loop.run_until_complete(start_services()) # Run the services asynchronously
82
  except KeyboardInterrupt:
83
  print("\n------------------ Stopping Services KeyBoard Interrupt -----------------")
 
29
  logging.getLogger("pyrogram").setLevel(logging.ERROR)
30
  logging.getLogger("aiohttp.web").setLevel(logging.ERROR)
31
 
32
+ server = web.AppRunner(web_server()) # Initialize the app runner
33
+ loop = asyncio.get_event_loop() # Ensure the event loop is retrieved correctly
34
+
35
  async def start_services():
36
  print(
37
  "****\n"
 
55
  print("------------------------------ DONE ------------------------------\n\n")
56
 
57
  print("--------------------- Initializing Web Server ---------------------")
 
58
  await server.setup() # Setup the web server
59
  await web.TCPSite(server, Server.BIND_ADDRESS, Server.PORT).start()
60
  print("------------------------------ DONE ------------------------------\n\n")
 
79
 
80
  if __name__ == "__main__":
81
  try:
 
82
  loop.run_until_complete(start_services()) # Run the services asynchronously
83
  except KeyboardInterrupt:
84
  print("\n------------------ Stopping Services KeyBoard Interrupt -----------------")