Skip to content

Commit

Permalink
Crashing netunnel when there is a really bad exception, so it would r…
Browse files Browse the repository at this point in the history
…estart
  • Loading branch information
urihclaroty committed Dec 8, 2022
1 parent 0055d0e commit 850c394
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/

.DS_Store
5 changes: 2 additions & 3 deletions netunnel/server/static_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import time
import aiohttp
import sys
import logging
import asyncio
import contextlib
Expand Down Expand Up @@ -155,9 +156,7 @@ async def _tunnel_keep_alive(self):
self._logger.warning('Failed to authenticate with `%s`', self._client.server_url)
else:
self._logger.exception('Failed to establish a tunnel with the peer `%s`:', self._client.server_url)
self._logger.info('Waiting %s seconds before retrying...', self._connection_retry_interval)
await asyncio.sleep(self._connection_retry_interval)

sys.exit(1)

async def stop(self, force=True):
"""
Expand Down

0 comments on commit 850c394

Please sign in to comment.