修复(履约绑定): 客户资料不全时禁止开始绑定
- 自动选号后不再在缺少游戏主页截图时启动绑定 - 补启动查询只挑资料完整的任务,避免阻塞后续任务 - 客户绑定启动接口校验角色/登录方式/系统/截图
This commit is contained in:
@@ -10,13 +10,13 @@ from datetime import UTC, datetime, timedelta
|
||||
from typing import Any
|
||||
|
||||
from loguru import logger
|
||||
from sqlalchemy import or_
|
||||
from sqlalchemy import func, or_
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ...database import WorkerSessionLocal
|
||||
from ...models import PlatformFulfillmentTask
|
||||
from . import service
|
||||
from .common import FLOW_VERSION_CLEAN
|
||||
from .common import FLOW_VERSION_CLEAN, _has_game_home_profile
|
||||
|
||||
DEFAULT_INTERVAL_SECONDS = 20
|
||||
DEFAULT_MIN_INTERVAL_SECONDS = 5
|
||||
@@ -194,6 +194,8 @@ def run_auto_allocation_once(
|
||||
if allocated_task is not None:
|
||||
allocated_task.next_allocate_at = None
|
||||
db.commit()
|
||||
if not _has_game_home_profile(allocated_task):
|
||||
continue
|
||||
try:
|
||||
service.start_binding_sync(
|
||||
db,
|
||||
@@ -280,6 +282,10 @@ def start_allocated_bindings_once(
|
||||
PlatformFulfillmentTask.binding_status == "not_started",
|
||||
PlatformFulfillmentTask.account_id.isnot(None),
|
||||
PlatformFulfillmentTask.lease_id.isnot(None),
|
||||
PlatformFulfillmentTask.customer_role_name != "",
|
||||
PlatformFulfillmentTask.customer_platform != "",
|
||||
PlatformFulfillmentTask.customer_system != "",
|
||||
func.json_length(PlatformFulfillmentTask.customer_home_images) > 0,
|
||||
)
|
||||
.order_by(
|
||||
PlatformFulfillmentTask.updated_at.asc(), PlatformFulfillmentTask.id.asc()
|
||||
@@ -292,6 +298,8 @@ def start_allocated_bindings_once(
|
||||
actor = service._integration_actor(db)
|
||||
started = 0
|
||||
for task in rows:
|
||||
if not _has_game_home_profile(task):
|
||||
continue
|
||||
try:
|
||||
service.start_binding_sync(
|
||||
db,
|
||||
|
||||
Reference in New Issue
Block a user