Skip to content

Commit 6984332

Browse files
committed
Use micro seconds for by-creation index
1 parent 5dab7a6 commit 6984332

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/redis/diagnostics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ func (rb *redisBackend) GetWorkflowInstances(ctx context.Context, afterInstanceI
1717
max := "+inf"
1818

1919
if afterInstanceID != "" {
20-
afterID := instanceSegment(core.NewWorkflowInstance(afterInstanceID, afterExecutionID))
21-
scores, err := rb.rdb.ZMScore(ctx, rb.keys.instancesByCreation(), afterID).Result()
20+
afterSegmentID := instanceSegment(core.NewWorkflowInstance(afterInstanceID, afterExecutionID))
21+
scores, err := rb.rdb.ZMScore(ctx, rb.keys.instancesByCreation(), afterSegmentID).Result()
2222
if err != nil {
23-
return nil, fmt.Errorf("getting instance score for %v: %w", afterID, err)
23+
return nil, fmt.Errorf("getting instance score for %v: %w", afterSegmentID, err)
2424
}
2525

2626
if len(scores) == 0 {

backend/redis/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (rb *redisBackend) CreateWorkflowInstance(ctx context.Context, instance *wo
5858
event.ID,
5959
eventData,
6060
payloadData,
61-
time.Now().UTC().Unix(),
61+
time.Now().UTC().UnixNano(),
6262
).Result()
6363

6464
if err != nil {

0 commit comments

Comments
 (0)