feat(bas): dispatch阶段生成run_id并透传到job便于复盘
This commit is contained in:
@@ -1620,6 +1620,10 @@ class PlatformOrderController extends Controller
|
||||
return redirect()->back()->with('warning', '检测到刚刚已提交过同一批次的 BAS 任务(1 分钟内)。为避免重复投递,本次未再次提交。');
|
||||
}
|
||||
|
||||
// run_id:用于把一次批量执行关联起来,便于后续追溯/筛选/可观测。
|
||||
// 说明:run_id 在投递阶段就生成,这样运营在页面成功提示里即可复制 run_id 并进入批次复盘页。
|
||||
$runId = 'BAS' . now()->format('YmdHis') . str_pad((string) random_int(1, 9999), 4, '0', STR_PAD_LEFT);
|
||||
|
||||
\App\Jobs\BatchActivateSubscriptionsJob::dispatch(
|
||||
$orderIds,
|
||||
(int) $admin->id,
|
||||
@@ -1628,9 +1632,10 @@ class PlatformOrderController extends Controller
|
||||
(int) $limit,
|
||||
(int) $matchedTotal,
|
||||
(int) $processed,
|
||||
(string) $runId,
|
||||
);
|
||||
|
||||
return redirect()->back()->with('success', '批量同步订阅任务已提交到队列:命中 ' . $matchedTotal . ' 条,本次处理 ' . $processed . ' 条(limit=' . $limit . ')。');
|
||||
return redirect()->back()->with('success', '批量同步订阅任务已提交到队列:命中 ' . $matchedTotal . ' 条,本次处理 ' . $processed . ' 条(limit=' . $limit . ',run_id=' . $runId . ')。');
|
||||
}
|
||||
|
||||
public function batchMarkPaidAndActivate(Request $request, SubscriptionActivationService $service): RedirectResponse
|
||||
|
||||
Reference in New Issue
Block a user