feat(fulfillment): 增加账号商品能力索引与生命周期事件
This commit is contained in:
@@ -6,6 +6,12 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .jobs.account_capability_refresh import (
|
||||
JOB_KEY as ACCOUNT_CAPABILITY_REFRESH_KEY,
|
||||
)
|
||||
from .jobs.account_capability_refresh import (
|
||||
run_account_capability_refresh,
|
||||
)
|
||||
from .jobs.account_overview_refresh import (
|
||||
JOB_KEY as ACCOUNT_OVERVIEW_REFRESH_KEY,
|
||||
)
|
||||
@@ -45,6 +51,7 @@ from .scheduler import (
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ACCOUNT_CAPABILITY_REFRESH_KEY",
|
||||
"ACCOUNT_OVERVIEW_REFRESH_KEY",
|
||||
"CK_HEALTH_KEY",
|
||||
"CK_RELOGIN_KEY",
|
||||
@@ -58,6 +65,7 @@ __all__ = [
|
||||
"register_job",
|
||||
"registered_jobs",
|
||||
"reset_registry",
|
||||
"run_account_capability_refresh",
|
||||
"run_account_overview_refresh",
|
||||
"run_ck_health",
|
||||
"run_ck_relogin",
|
||||
@@ -74,6 +82,18 @@ __all__ = [
|
||||
|
||||
def register_default_jobs() -> None:
|
||||
"""登记内置作业(幂等)。"""
|
||||
register_job(
|
||||
JobSpec(
|
||||
key=ACCOUNT_CAPABILITY_REFRESH_KEY,
|
||||
title="履约商品能力补充刷新",
|
||||
# 只刷新有 pending 履约需求且能力快照已过期的账号。
|
||||
interval_seconds=3600,
|
||||
run_interval_seconds=5 * 60,
|
||||
batch_size=100,
|
||||
concurrency=3,
|
||||
run=run_account_capability_refresh,
|
||||
)
|
||||
)
|
||||
register_job(
|
||||
JobSpec(
|
||||
key=POINTS_EXPIRE_KEY,
|
||||
|
||||
Reference in New Issue
Block a user