Skip to content

Commit 40e5c44

Browse files
committed
Add description to ConflictException log warning
1 parent a286bdb commit 40e5c44

File tree

1 file changed

+7
-5
lines changed
  • packages/syncKnowledgeBaseFunction

1 file changed

+7
-5
lines changed

packages/syncKnowledgeBaseFunction/app.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def handler(event, context):
3232
logger.error(
3333
"Missing required environment variables",
3434
extra={
35-
"statusCode": 500,
35+
"status_code": 500,
3636
"knowledge_base_id": bool(knowledge_base_id),
3737
"data_source_id": bool(data_source_id),
3838
},
@@ -132,7 +132,7 @@ def handler(event, context):
132132
logger.info(
133133
"Knowledge base sync process completed",
134134
extra={
135-
"statusCode": 200,
135+
"status_code": 200,
136136
"trigger_files_processed": len(processed_files),
137137
"ingestion_jobs_started": len(job_ids),
138138
"job_ids": job_ids,
@@ -158,23 +158,25 @@ def handler(event, context):
158158
# Handling for ConflictException
159159
if error_code == "ConflictException":
160160
logger.warning(
161-
"Ingestion job already in progress",
161+
"Ingestion job already in progress - no action required",
162162
extra={
163163
"status_code": 409,
164164
"error_code": error_code,
165165
"error_message": error_message,
166+
"description": "Files uploaded successfully and will be processed by existing ingestion job",
167+
"action_required": "none",
166168
"knowledge_base_id": knowledge_base_id,
167169
"data_source_id": data_source_id,
168170
"duration_ms": round((time.time() - start_time) * 1000, 2),
169-
"recommendation": (
171+
"explanation": (
170172
"This is normal when multiple files are uploaded quickly. "
171173
"The running job will process all files."
172174
),
173175
},
174176
)
175177
return {
176178
"statusCode": 409,
177-
"body": "Ingestion job already in progress - files will be processed by existing job",
179+
"body": "Files uploaded successfully - processing by existing ingestion job",
178180
}
179181
else:
180182
logger.error(

0 commit comments

Comments
 (0)