Skip to content

Commit

Permalink
Add reset to getters
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Sep 25, 2023
1 parent e2d4258 commit 74ebe96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/internal_event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,15 @@ func (wc *workflowEnvironmentImpl) Send(msg *protocolpb.Message, opts ...msgSend
wc.outbox = append(wc.outbox, outboxEntry{msg: msg, eventPredicate: sendCfg.pred})
}

func (wc *workflowEnvironmentImpl) getNewSdkName() string {
func (wc *workflowEnvironmentImpl) getNewSdkNameAndReset() string {
if wc.sdkNameUpdated {
wc.sdkNameUpdated = false
return wc.sdkName
}
return ""
}

func (wc *workflowEnvironmentImpl) getNewSdkVersion() string {
func (wc *workflowEnvironmentImpl) getNewSdkVersionAndReset() string {
if wc.sdkVersionUpdated {
wc.sdkVersionUpdated = false
return wc.sdkVersion
Expand Down
4 changes: 2 additions & 2 deletions internal/internal_task_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1772,8 +1772,8 @@ func (wth *workflowTaskHandlerImpl) completeWorkflow(
MeteringMetadata: &commonpb.MeteringMetadata{NonfirstLocalActivityExecutionAttempts: nonfirstLAAttempts},
SdkMetadata: &sdk.WorkflowTaskCompletedMetadata{
LangUsedFlags: langUsedFlags,
SdkName: eventHandler.getNewSdkName(),
SdkVersion: eventHandler.getNewSdkVersion(),
SdkName: eventHandler.getNewSdkNameAndReset(),
SdkVersion: eventHandler.getNewSdkVersionAndReset(),
},
WorkerVersionStamp: &commonpb.WorkerVersionStamp{
BuildId: wth.workerBuildID,
Expand Down

0 comments on commit 74ebe96

Please sign in to comment.