mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-02-16 18:31:45 +01:00
Let shutdown return immediately if server is not running
This commit is contained in:
parent
0cd7aa92ae
commit
7c9928c58f
1 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,17 @@ class WebhookServer(BaseHTTPServer.HTTPServer, object):
|
|||
RequestHandlerClass)
|
||||
self.update_queue = update_queue
|
||||
self.webhook_path = webhook_path
|
||||
self.is_running = False
|
||||
|
||||
def serve_forever(self, poll_interval=0.5):
|
||||
self.is_running = True
|
||||
super(WebhookServer, self).serve_forever(poll_interval)
|
||||
|
||||
def shutdown(self):
|
||||
if not self.is_running:
|
||||
return
|
||||
else:
|
||||
super(WebhookServer, self).shutdown()
|
||||
|
||||
|
||||
# WebhookHandler, process webhook calls
|
||||
|
|
Loading…
Add table
Reference in a new issue