Skip to content

Commit e4f2cb1

Browse files
committed
Remove historyId
1 parent 929cfd2 commit e4f2cb1

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

backend/redis/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (rb *redisBackend) GetWorkflowInstanceHistory(ctx context.Context, instance
7878
start := "-"
7979

8080
if lastSequenceID != nil {
81-
start = "(" + historyID(*lastSequenceID)
81+
start = fmt.Sprintf("(%d", *lastSequenceID)
8282
}
8383

8484
msgs, err := rb.rdb.XRange(ctx, rb.keys.historyKey(instance), start, "+").Result()

backend/redis/keys.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ func (k *keys) historyKey(instance *core.WorkflowInstance) string {
6060
return fmt.Sprintf("%shistory:%v", k.prefix, instanceSegment(instance))
6161
}
6262

63-
func historyID(sequenceID int64) string {
64-
return fmt.Sprintf("%v-0", sequenceID)
65-
}
66-
6763
func (k *keys) futureEventsKey() string {
6864
return fmt.Sprintf("%sfuture-events", k.prefix)
6965
}

backend/redis/scripts/complete_workflow_task.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ local executedEvents = tonumber(getArgv())
4040
local lastSequenceId = 0
4141
for i = 1, executedEvents do
4242
local eventId = getArgv()
43-
local historyId = getArgv()
4443
local eventData = getArgv()
4544
local payloadData = getArgv()
4645
local sequenceId = getArgv()
4746

4847
-- Add event to history
49-
redis.call("XADD", historyStreamKey, historyId, "event", eventData)
48+
redis.call("XADD", historyStreamKey, sequenceId, "event", eventData)
5049

5150
storePayload(eventId, payloadData)
5251

backend/redis/workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (rb *redisBackend) CompleteWorkflowTask(
130130
return fmt.Errorf("marshaling event payload: %w", err)
131131
}
132132

133-
args = append(args, event.ID, historyID(event.SequenceID), eventData, payloadData, event.SequenceID)
133+
args = append(args, event.ID, eventData, payloadData, event.SequenceID)
134134
}
135135

136136
// Remove executed pending events

0 commit comments

Comments
 (0)