6
6
from cachetools import LRUCache
7
7
from gidgethub import aiohttp as gh_aiohttp , routing , sansio
8
8
from gidgethub .apps import get_installation_access_token , get_jwt
9
- from glu import pylon , zendesk
9
+ from glu import pylon
10
+
11
+ # from glu import zendesk
10
12
import glu .events as event
11
13
from glu .config_loader import config
12
14
from glu import runtime_constants
@@ -65,7 +67,7 @@ async def main():
65
67
# await zendesk.init()
66
68
app = web .Application ()
67
69
app .router .add_post ("/" , github_payloads )
68
- app .router .add_post ("/zendesk" , zendesk .webhook_handler )
70
+ # app.router.add_post("/zendesk", zendesk.webhook_handler)
69
71
app .router .add_post ("/pylon" , pylon .webhook )
70
72
app .router .add_get ("/pylon/sidebar" , pylon .sidebar )
71
73
port = int (config ["server" ].get ("port" , 8000 ))
@@ -75,10 +77,20 @@ async def main():
75
77
await runner .setup ()
76
78
site = web .TCPSite (runner , host , port )
77
79
78
- await asyncio .gather (
79
- twitter_run (),
80
- site .start (),
81
- )
80
+ await site .start ()
81
+
82
+ try :
83
+ print (f"Server started at http://{ host } :{ port } " )
84
+ await asyncio .Event ().wait () # Keep the server running indefinitely
85
+ except KeyboardInterrupt :
86
+ print ("Shutting down the server..." )
87
+ finally :
88
+ await runner .cleanup ()
89
+
90
+ # await asyncio.gather(
91
+ # twitter_run(),
92
+ # site.start(),
93
+ # )
82
94
83
95
84
96
if __name__ == "__main__" :
0 commit comments