rhming / UnicomDailyTask

联通日常任务 腾讯云函数定时执行
MIT License
152 stars 77 forks source link

几点签到?为何运行了九点看app还没签到? #25

Open greenwave1987 opened 2 years ago

greenwave1987 commented 2 years ago

几点签到?为何运行了九点看app还没签到?数据储存里也有记录,得到些优惠券,也有日志。

greenwave1987 commented 2 years ago

如何测试运行某个脚本?我设置定时触发测试 { "version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "dailySign.py" } 执行失败,函数返回 { "errorMessage": "Expecting ',' delimiter: line 4 column 3 (char 289)", "errorType": "JSONDecodeError", "stackTrace": [ "File \"./index.py\", line 101, in main_handler", " Template(ZSMHAct) # 7", "File \"./index.py\", line 39, in Template", " ts.append(Thread(target=cls(mobile, password).run))", "File \"./activity/wolearn/zsmh.py\", line 11, in init", " super(ZSMHAct, self).init(mobile, password)", "File \"./activity/wolearn/wolearn.py\", line 13, in init", " super(WoLearn, self).init(mobile, password)", "File \"./utils/unicomLogin.py\", line 32, in init", " self.login()", "File \"./utils/unicomLogin.py\", line 100, in login", " \"appId\": self.getAppId(),", "File \"./utils/unicomLogin.py\", line 62, in getAppId", " appIds = json.loads(fp.read()) # type: dict", "File \"${RUNTIME_ROOT}/rtsp/python/lib/python3.6/json/init.py\", line 354, in loads", " return _default_decoder.decode(s)", "File \"${RUNTIME_ROOT}/rtsp/python/lib/python3.6/json/decoder.py\", line 339, in decode", " obj, end = self.raw_decode(s, idx=_w(s, 0).end())", "File \"${RUNTIME_ROOT}/rtsp/python/lib/python3.6/json/decoder.py\", line 355, in raw_decode", " obj, end = self.scan_once(s, idx)" ] } 日志内容: 2021/11/05 10:19:21 GMT+08:00 Start invoke request '7ca9fe83-4f4c-41e6-96f5-840b3109bfce', version: latest ###########################readCookie########################### 155****02 #############################login############################## 155****02 ###########################JSEncrypt############################ 155****02 ###########################JSEncrypt############################ 155****02 ############################getAppId############################ 155****02 2021/11/05 10:19:24 GMT+08:00 7ca9fe83-4f4c-41e6-96f5-840b3109bfce Function invocation catch a 'JSONDecodeError' exception(Expecting ',' delimiter: line 4 column 3 (char 289)) Traceback (most recent call last): File "./index.py", line 101, in main_handler Template(ZSMHAct) # 7 File "./index.py", line 39, in Template ts.append(Thread(target=cls(mobile, password).run)) File "./activity/wolearn/zsmh.py", line 11, in init super(ZSMHAct, self).init(mobile, password) File "./activity/wolearn/wolearn.py", line 13, in init super(WoLearn, self).init(mobile, password) File "./utils/unicomLogin.py", line 32, in init self.login() File "./utils/unicomLogin.py", line 100, in login "appId": self.getAppId(), File "./utils/unicomLogin.py", line 62, in getAppId appIds = json.loads(fp.read()) # type: dict File "${RUNTIME_ROOT}/rtsp/python/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "${RUNTIME_ROOT}/rtsp/python/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "${RUNTIME_ROOT}/rtsp/python/lib/python3.6/json/decoder.py", line 355, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 4 column 3 (char 289) 2021/11/05 10:19:24 GMT+08:00 Finish invoke request '7ca9fe83-4f4c-41e6-96f5-840b3109bfce'(invoke Failed), duration: 2218.371ms, billing duration: 2300ms, memory used: 116.238MB, rss memory used: 46.617MB.

rhming commented 2 years ago

触发器6-15点 每15分钟执行一次 每个任务只有在指定的时间才会执行 日志提示读取appId配置失败,appId配置文件要符合json规范,不要多了逗号

greenwave1987 commented 2 years ago

多帐号前几个最后是有个逗号,最后一个没有。我第二个和第三个之间少了一个,加上试试。