flowExecutionService 트랜잭션 처리 개선 및 데이터 변경 추적 로직 수정

This commit is contained in:
dohyeons
2025-12-09 11:15:18 +09:00
parent 8d07458c94
commit 0aaab45329
5 changed files with 156 additions and 123 deletions

View File

@@ -175,6 +175,12 @@ export class NodeFlowExecutionService {
try {
result = await transaction(async (client) => {
// 🔥 사용자 ID 세션 변수 설정 (트리거용)
const userId = context.buttonContext?.userId || "system";
await client.query("SELECT set_config('app.user_id', $1, true)", [
userId,
]);
// 트랜잭션 내에서 레벨별 실행
for (const level of levels) {
await this.executeLevel(level, nodes, edges, context, client);