Skip to content

Commit 56523d7

Browse files
committed
added isReplaying checks
1 parent 1f339a2 commit 56523d7

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

samples/src/main/java/io/durabletask/samples/ParentInstanceSample.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ public static void main(String[] args) throws IOException, InterruptedException,
3232
@Override
3333
public TaskOrchestration create() {
3434
return ctx -> {
35-
System.out.println(" [Parent] Starting child sub-orchestration...");
35+
if (!ctx.getIsReplaying()) {
36+
System.out.println(" [Parent] Starting child sub-orchestration...");
37+
}
3638
String childResult = ctx.callSubOrchestrator(
3739
"ChildOrchestrator", null, String.class).await();
38-
System.out.println(" [Parent] Child returned: " + childResult);
40+
if (!ctx.getIsReplaying()) {
41+
System.out.println(" [Parent] Child returned: " + childResult);
42+
}
3943
ctx.complete(childResult);
4044
};
4145
}
@@ -54,10 +58,14 @@ public TaskOrchestration create() {
5458
if (parent != null) {
5559
result = String.format("I was called by '%s' (instance: %s)",
5660
parent.getName(), parent.getInstanceId());
57-
System.out.println(" [Child] " + result);
61+
if (!ctx.getIsReplaying()) {
62+
System.out.println(" [Child] " + result);
63+
}
5864
} else {
5965
result = "No parent — I was started standalone";
60-
System.out.println(" [Child] " + result);
66+
if (!ctx.getIsReplaying()) {
67+
System.out.println(" [Child] " + result);
68+
}
6169
}
6270
ctx.complete(result);
6371
};

0 commit comments

Comments
 (0)