feat: 更新预约逻辑,允许在成功预约后继续进行决策而非直接返回
This commit is contained in:
1 parent
35819da24b
commit
a724de4094
1 file changed
+6
-33
@@ -5694,7 +5694,7 @@ def basic_join_decision(
|
||||
try:
|
||||
analyser._log_kv(
|
||||
"预约",
|
||||
"basic_join_decision:已更新预约队列中的福袋信息",
|
||||
"basic_join_decision:已更新预约队列中的福袋信息,继续进行决策",
|
||||
value_yuan=prize_value_yuan,
|
||||
future_ts=int(future_ts),
|
||||
room_pos=room_pos,
|
||||
@@ -5702,16 +5702,11 @@ def basic_join_decision(
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 更新预约成功后,直接返回,不参与抽奖
|
||||
elapsed = time.time() - start_time
|
||||
analyser._log_kv(
|
||||
"参与",
|
||||
"basic_join_decision完成(更新预约)",
|
||||
elapsed_seconds=round(elapsed, 2),
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
# 更新预约成功后,继续进行决策而不是直接返回
|
||||
# 设置标志表示预约已更新,后续决策会考虑这个信息
|
||||
reservation_updated = True
|
||||
|
||||
except Exception as e:
|
||||
try:
|
||||
analyser._log_kv(
|
||||
@@ -5723,28 +5718,6 @@ def basic_join_decision(
|
||||
except Exception:
|
||||
pass
|
||||
existing_reservation = None # 强制新增
|
||||
|
||||
# 如果没有现有预约或更新失败,则新增预约
|
||||
if existing_reservation is None:
|
||||
|
||||
def _add_reservation_with_flag(q, item):
|
||||
queue_full_flag[0] = douyin_reservation_logic.add_reservation_core_logic( # type: ignore[attr-defined]
|
||||
q,
|
||||
item,
|
||||
max_reservations=int(
|
||||
getattr(
|
||||
analyser, "high_value_fudai_max_reservations", 3
|
||||
)
|
||||
or 3
|
||||
),
|
||||
analyser=analyser,
|
||||
write_state_callback=_write_reservation_state,
|
||||
)
|
||||
|
||||
# 获取任务数量和其他详情信息(优先从缓存的福袋详情获取)
|
||||
task_count = 2 # 默认2个任务
|
||||
time_text = ""
|
||||
participants = 0
|
||||
copies = 0
|
||||
try:
|
||||
# 优先从缓存的福袋详情中获取信息
|
||||
|
||||
Reference in new issue
Block a user