chore(shipping-notice): 统一货代发货生命周期阶段命名并优化全链路业务逻辑
This commit is contained in:
1 parent
5ef8329bd8
commit
4ec4e57005
183 files changed
+14653
-3936
No files matched your search
@@ -56,6 +56,28 @@ def test_claim_next_shipping_recovers_stale_layout_jobs(app, monkeypatch):
|
||||
assert recovered == [True]
|
||||
|
||||
|
||||
def test_claim_next_shipping_claims_inventory_callback_process_job(app):
|
||||
"""库存 RPA 回调收件 Job 必须由 shipping worker 消费,不能永久停在 queued。"""
|
||||
from app import db
|
||||
from app.jobs import store
|
||||
|
||||
with app.app_context():
|
||||
job = Job(
|
||||
domain='shipping_notice',
|
||||
job_type=JobType.SHIPPING_INVENTORY_CALLBACK_PROCESS.value,
|
||||
status='queued',
|
||||
payload_json={'callback_id': 'callback-test'},
|
||||
)
|
||||
db.session.add(job)
|
||||
db.session.commit()
|
||||
|
||||
claimed = store.claim_next(queues=['shipping'])
|
||||
|
||||
assert claimed is not None
|
||||
assert claimed['id'] == job.id
|
||||
assert claimed['job_type'] == JobType.SHIPPING_INVENTORY_CALLBACK_PROCESS
|
||||
|
||||
|
||||
def test_find_shipping_notice_job_id_matches_task_no(app):
|
||||
from app import db
|
||||
from app.jobs.queue import _find_shipping_notice_job_id
|
||||
|
||||
Reference in new issue
Block a user