Skip to content

Commit 3f43cf2

Browse files
完善插件 cleanup 资源释放规范
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent d8e6c00 commit 3f43cf2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

TELEBOX_DEVELOPMENT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ utils/* (工具模块)
399399
`cleanup()` 不应依赖用户输入。
400400
`cleanup()` 不应误伤系统级资源。像 systemd 服务、iptables、dnsmasq、wireproxy 这种由显式命令管理的资源,不要在 reload 时偷偷停掉。
401401

402+
插件优先原则。
403+
404+
- 优先在插件内部持有并释放资源,不为单个插件的资源问题扩展全局框架。
405+
- 插件自己创建的 timer、child process、插件级缓存或 db 引用,应优先在插件自己的 `cleanup()` 中处理。
406+
- 只有已经被框架统一接管的资源(如 `cronTasks`、插件统一注册的 Telegram handlers)才依赖框架侧清理。
407+
402408
推荐模板。
403409

404410
```ts

0 commit comments

Comments
 (0)