LogicGoInfotechSpaces commited on
Commit
fa29786
·
verified ·
1 Parent(s): 0a6b2cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1150,11 +1150,12 @@ async def submit(
1150
 
1151
  if _mongo_collection is not None:
1152
  try:
 
1153
  _mongo_collection.insert_one({
1154
  "ts": int(time.time()),
1155
  "files": [os.path.basename(p) for p in saved_paths],
1156
  "timestamp": end_time.strftime("%Y-%m-%d %H:%M:%S"),
1157
- "status": "success",
1158
  "outputs": {
1159
  "images": final_images,
1160
  "zips": final_zips,
@@ -1183,7 +1184,7 @@ async def submit(
1183
  "ts": int(time.time()),
1184
  "files": [os.path.basename(p) for p in saved_paths],
1185
  "timestamp": end_time.strftime("%Y-%m-%d %H:%M:%S"),
1186
- "status": "fail",
1187
  "outputs": {},
1188
  "response_time_ms": response_time_ms,
1189
  "error": str(e)
 
1150
 
1151
  if _mongo_collection is not None:
1152
  try:
1153
+ forced_status = "failure" if len(final_images) == 0 else "success"
1154
  _mongo_collection.insert_one({
1155
  "ts": int(time.time()),
1156
  "files": [os.path.basename(p) for p in saved_paths],
1157
  "timestamp": end_time.strftime("%Y-%m-%d %H:%M:%S"),
1158
+ "status": forced_status,
1159
  "outputs": {
1160
  "images": final_images,
1161
  "zips": final_zips,
 
1184
  "ts": int(time.time()),
1185
  "files": [os.path.basename(p) for p in saved_paths],
1186
  "timestamp": end_time.strftime("%Y-%m-%d %H:%M:%S"),
1187
+ "status": "failure",
1188
  "outputs": {},
1189
  "response_time_ms": response_time_ms,
1190
  "error": str(e)