作者 赵彬吉

update

... ... @@ -47,8 +47,14 @@ class WorkchatMessageSend extends Command
$task->status = MessagePush::STATUS_SUCCESS;
}catch (ConnectionException $e){
$this->output('推送消息' . $task->id . '超时');
$task->status = MessagePush::STATUS_ERROR;
$task->remark = '请求超时';
if ($task->retry < 3) {
$task->status = MessagePush::STATUS_PENDING;
$task->retry = $task->retry + 1;
$task->send_time = date('Y-m-d H:i:s', strtotime('+ ' . $task->retry . ' minute'));
} else {
$task->status = MessagePush::STATUS_ERROR;
$task->remark = '请求超时';
}
}catch (\Exception $e){
$this->output('推送消息' . $task->id . '失败:' . $e->getMessage());
$task->status = MessagePush::STATUS_ERROR;
... ...