mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(lambda): list changed durable operations in creation order (#5328)
AWS lists the operations in a checkpoint answer, and the ids in UpdatedOperationIds, in the order they were created. Floci listed them in the order they changed, so a step finished after a newer one started, a wait that fell due, or a chained invoke that failed at once came out of place.
This commit is contained in:
1 parent
c8f16d2484
commit
9c2db353f1
2 files changed
+15
-2
No files matched your search
+1
-2
@@ -34,7 +34,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.time.Clock;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -1035,10 +1034,10 @@ public class DurableExecutionService implements Resettable {
|
||||
.orElseThrow(() -> new AwsException("ResourceNotFoundException", NOT_FOUND, 404));
|
||||
}
|
||||
|
||||
/** In creation order, as AWS lists them, not in the order they changed. */
|
||||
private static List<DurableOperation> unseenOperations(DurableExecution execution) {
|
||||
return execution.getOperations().values().stream()
|
||||
.filter(operation -> operation.getChangeSequence() > execution.getSeenSequence())
|
||||
.sorted(Comparator.comparingLong(DurableOperation::getChangeSequence))
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user