scons - How to gracefully kill a scons builder when scons is terminated?
问题描述
I've got a long running builder that renders videos. Sometimes during the build I'll notice that it's incorrect and want to kill it, and this requires sending an HTTP request to the render server. Is there some signal or hook in the scons system that I can use to determine when scons is shutting down so that I can send a message to the server?
解决方案
You can do something like this: (original code from SCons manpage) Put this in your SConstruct/SConscript
import atexit
def shutdown_my_server():
" do your stuff here "
pass
atexit.register(shutdown_my_server)
推荐阅读
- c# - 调用表值函数时,Linq Where on FromSqlInterpolated
- c# - c# 和 sqlite:如何修复过多的 SQL 变量?
- c# - “缺少 Mono 脚本”和“缺少此行为的引用脚本(未知)”错误
- javascript - firestore 为每个页面找到接下来的 20 个文档?
- tesseract - 使用 tesseract 和 opencv 从图像中提取文本
- python - 我想使用 pygame 在 python 中创建一个合并排序可视化器。代码没有给出正确的结果
- javascript - 重置输入值按钮仅在聚焦输入上可见不起作用
- python - std.constant' op 需要属性的类型来匹配 op 的返回类型
- elasticsearch - 在 Elasticsearch 中键入时检索不同的搜索值
- typescript - 无法调用可能是“未定义”的对象