fix: prevent S3 upload failures from crashing the entire execution result save
This commit is contained in:
parent
ba5a67905e
commit
bc31a69621
|
|
@ -416,6 +416,7 @@ public class AgentService {
|
||||||
|
|
||||||
String base64 = (String) stepData.get("screenshotBase64");
|
String base64 = (String) stepData.get("screenshotBase64");
|
||||||
if (base64 != null && !base64.isEmpty()) {
|
if (base64 != null && !base64.isEmpty()) {
|
||||||
|
try {
|
||||||
byte[] imageBytes = java.util.Base64.getDecoder().decode(base64);
|
byte[] imageBytes = java.util.Base64.getDecoder().decode(base64);
|
||||||
String fileName = "exec_" + executionId + "_step_" + sr.getId() + "_" + System.currentTimeMillis() + ".png";
|
String fileName = "exec_" + executionId + "_step_" + sr.getId() + "_" + System.currentTimeMillis() + ".png";
|
||||||
|
|
||||||
|
|
@ -428,6 +429,9 @@ public class AgentService {
|
||||||
sc.setContentType("image/png");
|
sc.setContentType("image/png");
|
||||||
sc.setStoragePath(s3Url);
|
sc.setStoragePath(s3Url);
|
||||||
screenshotRepository.save(sc);
|
screenshotRepository.save(sc);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
System.err.println("Failed to upload screenshot to S3: " + ex.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue