Handle TCPTransport closed exception
All checks were successful
continuous-integration/drone Build is passing
All checks were successful
continuous-integration/drone Build is passing
This commit is contained in:
parent
22e623a992
commit
c02d23cead
@ -195,8 +195,12 @@ async def view_export(request):
|
|||||||
mk, lock = pool[target]
|
mk, lock = pool[target]
|
||||||
|
|
||||||
async with lock:
|
async with lock:
|
||||||
|
try:
|
||||||
async for line in wrap(scrape_mikrotik(mk)):
|
async for line in wrap(scrape_mikrotik(mk)):
|
||||||
await response.send(line + "\n")
|
await response.send(line + "\n")
|
||||||
|
except RuntimeError:
|
||||||
|
# Handle TCPTransport closed exception
|
||||||
|
pool.pop(target)
|
||||||
|
|
||||||
|
|
||||||
app.run(host="0.0.0.0", port=3001)
|
app.run(host="0.0.0.0", port=3001)
|
||||||
|
Reference in New Issue
Block a user