|
5 | 5 |
|
6 | 6 | from apscheduler.triggers.cron import CronTrigger |
7 | 7 | from funboost import boost, funboost_aps_scheduler, funboost_current_task |
| 8 | +from funboost.timing_job.apscheduler_use_redis_store import funboost_background_scheduler_redis_store |
8 | 9 | from nb_time import NbTime |
9 | 10 |
|
10 | 11 | from app.model.syncer_model import Jobs, DiscoveryInstance, Registration |
@@ -51,7 +52,7 @@ def get_gateway_client(name: str) -> Gateway: |
51 | 52 |
|
52 | 53 |
|
53 | 54 | def clear_client(): |
54 | | - funboost_aps_scheduler.remove_all_jobs() |
| 55 | + funboost_background_scheduler_redis_store.remove_all_jobs() |
55 | 56 | from app.model.config import discovery_clients, gateway_clients |
56 | 57 |
|
57 | 58 | discovery_clients.clear() |
@@ -206,18 +207,18 @@ def reload(): |
206 | 207 | Jobs(**target.dict()).save_or_update(sqla_helper) |
207 | 208 | # 注册定时任务 |
208 | 209 | if next_run_time: |
209 | | - funboost_aps_scheduler.add_push_job(syncer, id=target.id, name=target.id, |
| 210 | + funboost_background_scheduler_redis_store.add_push_job(syncer, id=target.id, name=target.id, |
210 | 211 | next_run_time=next_run_time, |
211 | 212 | kwargs={"target": target.model_dump()}, replace_existing=True) |
212 | 213 | else: |
213 | | - funboost_aps_scheduler.add_push_job(syncer, id=target.id, name=target.id, |
| 214 | + funboost_background_scheduler_redis_store.add_push_job(syncer, id=target.id, name=target.id, |
214 | 215 | trigger=CronTrigger(second=second, minute=minute, hour=hour, |
215 | 216 | day=day, month=month, |
216 | 217 | day_of_week=day_of_week), |
217 | 218 | kwargs={"target": target.model_dump()}, replace_existing=True) |
218 | 219 | # 健康检查 |
219 | 220 | if target.healthcheck: |
220 | | - funboost_aps_scheduler.add_push_job(health_check, id="health-check", |
| 221 | + funboost_background_scheduler_redis_store.add_push_job(health_check, id="health-check", |
221 | 222 | name="health-check", |
222 | 223 | trigger=CronTrigger(second=second, minute=minute, hour=hour, |
223 | 224 | day=day, month=month, |
|
0 commit comments