重播编排时是否应调用 SetCustomStatus()?

Should SetCustomStatus() be called when orchestration is replayed?

调用时是否需要检查上下文是否正在重播SetCustomStatus():

if (!context.IsReplaying)
{
    context.SetCustomStatus("My status");
}

这样做有什么好处吗?我在 the documentation.

中找不到对此的任何提及

我试过这个,但我不推荐它,因为它会有效地使你的协调器功能不确定。协调器函数在每次重播时执行完全相同的逻辑非常重要。

来自docs

Orchestrator code must be deterministic. It will be replayed multiple times and must produce the same result each time.

主要的例外是日志记录,因为它对编排本身的行为没有影响。