Skip to content

Commit 1acc447

Browse files
refactor: rename 'openai_batch_' to 'batch_' in configuration and update related cache key references
1 parent f8bd42a commit 1acc447

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/configs/constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'metrix_bridges_' : 'metrix_bridges_',
4141
'rate_limit_' : 'rate_limit_',
4242
'files_' : 'files_',
43-
'openai_batch_' : 'openai_batch_',
43+
'batch_' : 'batch_',
4444
'avg_response_time_' : 'avg_response_time_',
4545
'gpt_memory_' : 'gpt_memory_',
4646
'timezone_and_org_' : 'timezone_and_org_',

src/services/commonServices/openAI/openai_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def batch_execute(self):
9393
"batch_variables": batch_variables,
9494
"custom_id_mapping": {item["custom_id"]: idx for idx, item in enumerate(message_mappings)}
9595
}
96-
cache_key = f"{redis_keys['openai_batch_']}{batch_file.id}"
96+
cache_key = f"{redis_keys['batch_']}{batch_file.id}"
9797
await store_in_cache(cache_key, batch_json, ttl = 86400)
9898
return {
9999
"success": True,

src/services/utils/batch_script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def repeat_function():
2020
async def check_batch_status():
2121
try:
2222
print("Batch Script running...")
23-
batch_ids = await find_in_cache_with_prefix('openai_batch_')
23+
batch_ids = await find_in_cache_with_prefix('batch_')
2424
if batch_ids is None:
2525
return
2626
for id in batch_ids:
@@ -96,7 +96,7 @@ async def check_batch_status():
9696
has_success = any(item.get("status_code") is None or item.get("status_code", 200) < 400 for item in file_content)
9797

9898
await sendResponse(response_format, data=file_content, success=has_success)
99-
cache_key = f"{redis_keys['openai_batch_']}{batch_id}"
99+
cache_key = f"{redis_keys['batch_']}{batch_id}"
100100
await delete_in_cache(cache_key)
101101
finally:
102102
# Ensure http_client is properly closed

0 commit comments

Comments
 (0)