Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Telergam 异步发送通知时可能出现异常中断 #1017

Closed
3 tasks done
ghost opened this issue Apr 20, 2020 · 0 comments
Closed
3 tasks done

[BUG] Telergam 异步发送通知时可能出现异常中断 #1017

ghost opened this issue Apr 20, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 20, 2020

请将 [ ] 替换为 [x] 。Please relpace [ ] with [x] .

  • 我已知晓并同意,如果我不遵循以下格式提交 issue,或者我使用的并非最新版本的 SSPanel UIM,或者我没有提供足够的信息,或者我没有选中这些框,则我的 issue 可能会被无条件关闭和锁定。 I acknowledge if I don't follow the format below, or I'm on an old commit, or I fail to provide sufficient information, or I don't check these box, my issue could be closed without any notice.
  • 我已确认我已经阅读过使用文档、Wiki,并在 issue 列表中查找相似的问题。I certify that I have read project Wiki and other issue may related to this one.
  • 我已知晓并同意,如果我不同意上述条件却仍然提交 issue,或即使同意上述条件但在提交 issue 时不按照条件执行,我的 issue 可被 SSPanel UIM 维护团队视为 spam、并在必要时会被举报到 GitHub。 I acknowledge if I disagree with the conditions above but still submit a issue, or if I agree conditions above but do not follow them when submitting a issue, my issue could be considered as spam by the SSPanel UIM maintenance team, and might be reported to GitHub if necessary.

Environment 环境
CentOS 7
PHP 7.3
MariaDB 10.3

Commit
a8b91f9

Bug
Telergam 给用户发送每日通知,出现异常中断

Reproduce
众所周知,Telergam 在长时间不未使用时会被注销,假设用户已经绑定TG到面板并开启每日通知,在长时间未登陆 Telergam 导致账户被注销后。面板执行 sendDiaryMail 时会抛出异常并中断任务。

Expected behavior
捕获异常,并继续执行任务。

Logs

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://api.telegram.org/*****************/sendMessage resulted in a 403 Forbidden response:
{"ok":false,"error_code":403,"description":"Forbidden: user is deactivated"}
in /www/wwwroot/top/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /www/wwwroot/top/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /www/wwwroot/top/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /www/wwwroot/top/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /www/wwwroot/top/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#4 /www/wwwroot/top/vendor/guzzlehttp/guzzle in /www/wwwroot/top/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

Addition
$bot = new Api($_ENV['telegram_token'], $async);
改为
$bot = new Api($_ENV['telegram_token']);

关闭异步发送时可以正常捕获异常并继续执行,但这影响效率。

Repository owner deleted a comment from du5 Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant