Comments (5)
问的很好,
所以funboost 提供了持久化的apschudler对象,
你可以看 funboost/timing_job/apscheduler_use_redis_store.py 的funboost_background_scheduler_redis_store对象, 你还可以使用任何 mysql mongo来作为持久化的定时存储,
funboost_background_scheduler_redis_store = FunboostBackgroundScheduler(timezone=FunboostCommonConfig.TIMEZONE, daemon=False, jobstores=jobstores)
由什么存储,其实是和 jobstores 有关,aspcheduler原生就支持 jobstores 入参了, 你可以看看4.4.b文档,里面用的就是funboost_background_scheduler_redis_store 对象
from funboost.
你可以按照redis作为定时任务持久化的例子,使用任何数据库作为定时任务持久化,还是比较简单的
from funboost.
APScheduler库本身是支持持久化的 但是在你框架中的funboost_aps_scheduler是基于内存的方式实现的定时任务,也就是说如果我执行一个较长时间后才执行的一个定时任务,万一中途出现程序中断服务器宕机这样的情况的话,该任务就会丢失,不知道我这样的理解是否正确。 我目前有两个场景需要用到定时任务,第一个是订单状态的转化,如果用户超过15min未支付,需要将该订单的状态设置为关闭。 第二个场景是这样的,用户在下订单后,需要与一种公共资源建立关联,这种关联是多对多的关系,因此我需要在这个公共资源上设置一个字段表示资源是否可用,我需要在一年后将这个资源进行释放,也就是修改这个字段。 按照我从funboost文档中的理解,使用funboost_aps_scheduler如果中途程序关闭就会丢失此任务,不知道我的理解是否正确,另外我不太清楚情景2采用一年后执行的定时任务这种方案,是否是一种比较好的方案,感谢作者提供这么优秀的框架,希望作者替我解惑
持久化是都是支持的,对于场景2,应该不是真的设定一个一年之后的定时任务吧,应该是定义一个每天(根据实际的及时性要求,设定心跳)的定时任务,检测资源是否已经满足一年期限。
from funboost.
都可以,持久化后定时任务就不会丢失了,jobstores也可以定义成mysql或者mongo来存储,这些用法其实是和aspcheduler关系大,和funboost关系不大
from funboost.
感谢解答🙏
from funboost.
Related Issues (20)
- pip包太厚重了, 能不能搞精简一点的, 比如我就只需要redis跟异步就可以了, 其他的完全不需要 HOT 10
- 接受非booster传过来的消息,没有extra, 导致consume 失败 HOT 1
- result_web. index.html 中 其中的一个css文件无法下载了 “bootstrap.min.css” HOT 1
- 姑且提醒下这个repo错别字连篇
- [BUG]ModuleNotFoundError: No module named 'db_libs' [contrib里面是作者额外贡献的功能,需要用户自己安装相关三方包] HOT 3
- 请教: 如何使用 nb_log 打印task_id HOT 19
- BUG: AttributeError("'_thread._local' object has no attribute 'function_result_status'" HOT 7
- 【bug】可能存在的bug- 在线急等修复(我就不用再加猴子补丁了~~)[用户自己写法错误问题] HOT 8
- windows上的脚本到linux上远程执行时的路径不正确 HOT 9
- 你好,我想请教一下使用Rocketmq作为中间件时自定义消费者类的问题 HOT 9
- AttributeError: '_thread._local' object has no attribute 'fct_context'报错 HOT 1
- 偶尔能成功【AmqpStorm确认消费失败】,(答: rabbbitmq服务端RABBITMQ_CONSUMER_TIMEOUT 配置问题) HOT 4
- [请教]如何手动设置 task_id HOT 5
- 使用文档4.32中的类方法方法push信息时,总是报错类没有__name__属性【用户使用错误】 HOT 19
- 升级 apschedular 到 4.x HOT 1
- vscode运行测试例子,报No module named 'lexicon' HOT 12
- 框架启动自动消费时,django中使用manage.py 非阻塞命令会阻塞进程【解决:建议web和启动消费单独分2次部署】 HOT 5
- 能不能将包上传conda-forge源
- 可视化,启动状态结果web失败 【用户python环境问题,用户已解决】
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from funboost.