Message is not sent if shutdown immediately
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
- 领域
- backend
调研方向
先从 Slack appender 和链接的 feature-support-shutdown 对比开始,然后检查 log4js.shutdown() 如何检查是否支持 shutdown。验证立即终止示例和建议的 callback 行为;当 Slack 请求可以完成,或在进程退出前获得建议的等待时间时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Overview
Since this module doesn't have shutdown function, request to slack is not reached if log4js.shutdown() is called and process is terminated right after message event.
For example:
https://github.com/expressjs/generator/blob/master/templates/js/www.ejs#L68
When I replace this logging with log4js + slack appender, it will not notify to slack.
Even if I put process.exit(1) within shutdown callback like
const log4js = require('log4js');
const logger = log4js.getLogger();
logger.error(bind + ' requires elevated privileges');
log4js.shutdown(() => {
process.exit(1);
});
it still won't wait process.exit() since slack appender doesn't support it.
As seen in log4js-node, it checks function existence.
https://github.com/log4js-node/log4js-node/blob/master/lib/log4js.js#L117
Appendix
If following proposal diff looks good, I'll make Pull Req.
https://github.com/log4js-node/slack/compare/master...honeroku:feature-support-shutdown
It doesn't guarantee that all request is done, but I suppose 1sec is enough (or even too much) for slack api.
And I don't want over-decorate this tiny module, so I made minimum support.
- 主要语言
- JavaScript
- 星标
- 8
- 派生
- 8
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
log4js-node/slack 的其他 Issue
-
help wanted
难度 5/5 一周以上 新手友好度 25/100
log4js-node/slack#2 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
log4js-node/slack#1 · 1 个 reaction ·
查看 log4js-node/slack 的全部 Issue
相似的 Issue
-
macOS
难度 2/5 1-3 小时 新手友好度 76/100
beyondcode/herd-community#1761 ·
-
content good first issue hacktoberfest
难度 2/5 1-3 小时 新手友好度 74/100
vieanderes/understory#19 ·
-
automated issue report
难度 2/5 1-3 小时 新手友好度 68/100
lirantal/discoprint#37 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
tauri-apps/tauri#16219 ·
维护者通常 2 天内回复
-
agentic-workflows
难度 1/5 1 小时以内 新手友好度 90/100
githubnext/gh-aw-cao#16599 ·
维护者通常 1 天内回复