Skip to content

[Question] Necessary to check IsReplaying before SetCustomStatus?Β #1240

@colbylwilliams

Description

@colbylwilliams

Question

Is it necessary to check if an orchestration function is replaying before setting a custom status? For example:

if (!functionContext.IsReplaying)
    functionContext.SetCustomStatus("Creating Project");

var _ = await functionContext
      .CallActivityAsync<Guid>(nameof(CreateProjectActivity), project);

if (!functionContext.IsReplaying)
    functionContext.SetCustomStatus("Creating Project Users");

var _ = await functionContext
      .CallActivityAsync<Guid>(nameof(CreateProjectUsersActivity), project);

functionContext.SetCustomStatus("Project Created");

Or is this handled automatically? I'd assume replays are fast, but I'm not sure how long it takes for the CustomStatus to be persisted and available via the HTTP APIs. So if I don't check IsReplaying is there an (edge) chance that the HTTP API could return "Creating Project" even though CreateProjectUsersActivity is really already finished? (i.e. the HTTP API was queried mid-replay)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions