成功了一次定时抢座,原来之前是mainloop没运行,但是现在还是有问题如果task里有捡漏的任务(就算是以前布置的)
也会导致error,而且不管是抢座成功或失败一直都有这个错
Traceback (most recent call last):
File "/root/igotolibrary/utils.py", line 34, in wrapper
return func(*args, **kwargs)
File "/root/igotolibrary/utils.py", line 1072, in get_value
result = self.client.get(key=key, default=default)
File "/usr/local/lib/python3.6/site-packages/pymemcache/client/base.py", line 534, in get
return self._fetch_cmd(b'get', [key], False).get(key, default)
File "/usr/local/lib/python3.6/site-packages/pymemcache/client/base.py", line 899, in _fetch_cmd
self._connect()
File "/usr/local/lib/python3.6/site-packages/pymemcache/client/base.py", line 336, in _connect
sock.connect(sockaddr)
ConnectionRefusedError: [Errno 111] Connection refused
所以现在感觉功能很不稳定的样子o(╥﹏╥)o😭
如下是mainloop的日志:
SELECT * FROM today_task WHERE (task_kind='realtime' AND open_time < '19:39:30') OR ( open_time >= '19:36:30' AND open_time < '19:39:30' ) ; [{'id': 4, 'task_id': 22226, 'userid': 'zi', 'task_kind': 'realtime', 'wechat_sess_id': 'wechatSESS_ID=46c21bcccca7f1d157d5bb20df73f66d9c334ab96e84053b', 'succ_failed': '', 'detail_info': '', 'others_result_info': '', 'user_name': '子', 'school_name': '江汉大学', 'schl_abbr': 'jhun', 'open_time': '14:40:51', 'classroom_name1': '二楼报刊阅览室 (2楼)', 'libid1': 20027, 'seat_num1': 0, 'coordinate1': '0', 'classroom_name2': '二楼报刊阅览室 (2楼)', 'libid2': 20027, 'seat_num2': 0, 'coordinate2': '0', 'serverid': 'b9fc7bd86d2eed91b23d7347e0ee995e|1602830449|1570361133', 'comment_info': '', 'submit_time': '2020-10-16 14:40:51', 'pattern': 'TODAY', 'platform': 'IGTL', 'others_info': '{"all_lib_clssrm": {"20027": "\u4e8c\u697c\u62a5\u520a\u9605\u89c8\u5ba4 (2\u697c)", "10158": "\u4e09\u697c\u5927\u5385 (3\u697c)", "115599": "304\u4e09\u697c\u4eba\u6587\u793e\u4f1a\u79d1\u5b66\u9605\u89c8\u5ba4\uff08\u4e09 \uff09 (3\u697c)", "116299": "301\u4e09\u697c\u4eba\u6587\u793e\u4f1a\u79d1\u5b66\u9605\u89c8\u5ba4\uff08\u4e00\uff09 (3\u697c)", "10156": "\u56db\u697c\u5927\u5385 (4\u697c)", "115578": "401\u5916\u6587\u6587\u732e\u9605\u89c8\u5ba4 (4)", "117895": "405\u5916\u6587\u8fc7\u520a\u9605\u89c8\u5ba4 (4\u697c)", "10154": "503\u4eba\u6587\u793e\u4f1a\u79d1\u5b66\u6587\u732e\u5178\u85cf\u9605\u89c8\u5ba4\uff08\u4e8c\uff09 (5\u697c)", "20030": "505\u81ea\u79d1\u5178\u85cf (5\u697c)", "115564": "501\u793e\u79d1\u6587\u732e\u5178\u85cf\u9605\u89c8\u5ba4 (5)", "115571": "\u4e94\u697c\u5927\u5385 (5)"}}'}]
----#2020.10.16_19:36:31.086|[run] realtime_1_22226_22226 thread start run
----#2020.10.16_19:36:31.087|[ERROR-BREAK]:func_name=get_value
Traceback (most recent call last):
File "/root/igotolibrary/utils.py", line 34, in wrapper
return func(*args, **kwargs)
File "/root/igotolibrary/utils.py", line 1072, in get_value
result = self.client.get(key=key, default=default)
File "/usr/local/lib/python3.6/site-packages/pymemcache/client/base.py", line 534, in get
return self._fetch_cmd(b'get', [key], False).get(key, default)
File "/usr/local/lib/python3.6/site-packages/pymemcache/client/base.py", line 899, in _fetch_cmd
self._connect()
File "/usr/local/lib/python3.6/site-packages/pymemcache/client/base.py", line 336, in _connect
sock.connect(sockaddr)
ConnectionRefusedError: [Errno 111] Connection refused
----#2020.10.16_19:36:31.087|[ERROR-BREAK]:func_name=run
Traceback (most recent call last):
File "/root/igotolibrary/utils.py", line 34, in wrapper
return func(*args, **kwargs)
File "/root/igotolibrary/reserve.py", line 551, in run
if task['task_id'] == tmp_mc_trace['task_id']:
TypeError: string indices must be integers