python - 无法在使用 gunicorn 预加载标志运行的烧瓶应用程序中使用 threadpoolexecutor
问题描述
我有一个烧瓶应用程序,我正试图用 gunicorn 放在前面。我想使用预加载标志,因为我的应用程序有一些使用 apscheduler 的计划作业,我只想在主服务器而不是工作人员中运行。
我还想在 python 中使用 ThreadPoolExecutor 将作业委托给由我的应用程序上的路由触发的后台。
当我将 --preload 标志与 gunicorn 一起使用时,对我的 threadpoolexecutor(使用 executor.submit)的任何调用似乎都失败了。当我通过 apscheduler 以编程方式触发作业时,似乎也会发生同样的情况。
当我不使用 --preload 标志时,一切运行顺利。
是否有一些配置我可以更改以使其正常工作,或者这不适用于 --preload 标志?
解决方案
推荐阅读
- r - 在带有 Apple M1 芯片的 MacBook 上安装 gfortran 以在 R 中使用
- angular - Angular 10 + AWS S3 + Cloudfront:没有哈希的导航
- excel - 按课程表按性别计算学生人数
- python - Hive 不支持子查询,我需要从自连接表中获取最大日期
- visual-studio-code - 如何使用 VS Code 的 API 获取正则表达式匹配的行号和字符位置?
- django - Django Boostrap TimePicker/Forms 不工作
- resourcedictionary - APP.XAML 的问题移至 .NET Core 5
- airflow - 如何在 Apache 气流中设置内容安全策略、hsts 和 x-xss 保护等安全标头
- matrix - openGL,变换的逆
- flutter - 如何在android studio的设备选择器下拉菜单中添加flutter web?