mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(lambda): show a durable step's attempt and result by its status (#8264)
* fix(lambda): show a durable step's attempt and result by its status
This commit is contained in:
1 parent
01d61afd8a
commit
ea8d875cad
3 files changed
+129
-4
No files matched your search
@@ -12,6 +12,7 @@ import io.floci.aws.services.lambda.durable.model.DurableExecution;
|
||||
import io.floci.aws.services.lambda.durable.model.DurableHistoryEvent;
|
||||
import io.floci.aws.services.lambda.durable.model.DurableOperation;
|
||||
import io.floci.aws.services.lambda.durable.model.DurableOperationAction;
|
||||
import io.floci.aws.services.lambda.durable.model.DurableOperationStatus;
|
||||
import io.floci.aws.services.lambda.durable.model.DurableOperationType;
|
||||
import io.floci.aws.services.lambda.durable.model.DurableOperationUpdate;
|
||||
|
||||
@@ -107,13 +108,16 @@ public final class DurableWire {
|
||||
}
|
||||
case STEP -> {
|
||||
ObjectNode details = node.putObject("StepDetails");
|
||||
if (operation.getAttempt() != null) {
|
||||
details.put("Attempt", operation.getAttempt());
|
||||
}
|
||||
details.put("Attempt", operation.getAttempt() == null ? 0 : operation.getAttempt());
|
||||
if (operation.getNextAttemptTimestamp() != null) {
|
||||
putTimestamp(details, "NextAttemptTimestamp", operation.getNextAttemptTimestamp(), millis);
|
||||
}
|
||||
putResultAndError(details, operation);
|
||||
// AWS shows a step's Result or Error only once it is READY or closed.
|
||||
DurableOperationStatus status = operation.getStatus();
|
||||
if (status == DurableOperationStatus.READY || status == DurableOperationStatus.SUCCEEDED
|
||||
|| status == DurableOperationStatus.FAILED) {
|
||||
putResultAndError(details, operation);
|
||||
}
|
||||
}
|
||||
case WAIT -> {
|
||||
ObjectNode details = node.putObject("WaitDetails");
|
||||
|
||||
Reference in new issue
Block a user