if 'failed' not in response:
self.ts = response['ts']
return [
self._parse_event(raw_event)
for raw_event in response['updates']
]
elif response['failed'] == 1:
self.ts = response['ts']
elif response['failed'] == 2:
self.update_longpoll_server(update_ts=False)
elif response['failed'] == 3:
self.update_longpoll_server()
return []
while True:
if 'failed' not in response:
self.ts = response['ts']
break
elif response['failed'] == 1:
self.ts = response['ts']
elif response['failed'] == 2:
self.update_longpoll_server(update_ts=False)
elif response['failed'] == 3:
self.update_longpoll_server()
if 'failed' not in response:
self.ts = response['ts']
return [
self._parse_event(raw_event)
for raw_event in response['updates']
]
return []
try:
Thread(target=self.input_event).start()
except Exception as e:
logging.error(e)
sys.exit(0)
Основная проблема в том, что бот работает в несколько потоков, по-этому когда возникает подобная ошибка скрипт не прекращает свою работу, systemd его не перезапускает и скрипт остается "висеть" пока его не перезапустить вручную.
2019-05-03 14:16:20,945:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:16:35,966:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:16:50,982:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:17:05,998:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:17:21,014:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:17:36,031:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:17:51,048:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:18:06,065:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:18:21,085:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:18:36,104:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:18:51,123:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 28
2019-05-03 14:19:02,710:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2691&wait=15 HTTP/1.1" 200 1248
2019-05-03 14:19:02,741:DEBUG:https://api.vk.com:443 "POST /method/users.get HTTP/1.1" 200 114
2019-05-03 14:19:06,344:DEBUG:https://lp.vk.com:443 "GET /wh181557869?act=a_check&key=a1e4be078f2eb43ae46fd911b088b7b57225b795&ts=2692&wait=15 HTTP/1.1" 200 317
2019-05-03 14:19:06,372:DEBUG:https://api.vk.com:443 "POST /method/users.get HTTP/1.1" 200 114
2019-05-03 14:19:06,811:DEBUG:https://api.vk.com:443 "POST /method/messages.send HTTP/1.1" 200 37
2019-05-03 14:19:06,812:DEBUG:Command: COMMAND FILTERS successful for 463080516