Documentation for workflow.Now is a bit vague
uberbo opened this issue · 0 comments
uberbo commented
Describe the bug
The documentation for workflow.Now seems to indicate that it returns a the current time when being replayed:
Now returns the current time when the decision is started or replayed.
But most people seem to assume that the returned time during a replay will be the same as the time returned during the first execution. It also seems that if it returns a the current time at replay it would lead to non-deterministic behavior, for example:
cutoff := time.Unix(1610102641, 0)
now := workflow.Now(ctx)
if now.Before(cutoff) {
// do something
} else {
// do something else
}
Can you clarify if workflow.Now actually "returns the current time when the decision is [...] replayed"?