Skip to content

Commit 1bf96cc

Browse files
authored
Fix CHASM Scheduler memo provider (temporalio#8779)
1 parent f00decb commit 1bf96cc

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

chasm/lib/scheduler/scheduler.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ type Scheduler struct {
5454
compiledSpec *scheduler.CompiledSpec // compiledSpec is only ever replaced whole, not mutated.
5555
}
5656

57+
var (
58+
_ (chasm.VisibilitySearchAttributesProvider) = (*Scheduler)(nil)
59+
_ (chasm.VisibilityMemoProvider) = (*Scheduler)(nil)
60+
)
61+
5762
const (
5863
// How many recent actions to keep on the Info.RecentActions list.
5964
recentActionCount = 10
@@ -697,19 +702,8 @@ func (s *Scheduler) SearchAttributes(chasm.Context) []chasm.SearchAttributeKeyVa
697702
// Memo returns the scheduler's info block for visibility.
698703
func (s *Scheduler) Memo(
699704
ctx chasm.Context,
700-
) map[string]chasm.VisibilityValue {
701-
newInfo := s.ListInfo(ctx)
702-
703-
infoPayload, err := proto.MarshalOptions{
704-
Deterministic: true,
705-
}.Marshal(newInfo)
706-
if err != nil {
707-
return nil
708-
}
709-
710-
return map[string]chasm.VisibilityValue{
711-
visibilityMemoFieldInfo: chasm.VisibilityValueByteSlice(infoPayload),
712-
}
705+
) proto.Message {
706+
return s.ListInfo(ctx)
713707
}
714708

715709
// ListInfo returns the ScheduleListInfo, used as the visibility memo, and to

0 commit comments

Comments
 (0)