Skip to content

Commit 5e1deb6

Browse files
committed
fix: revert redis notifier watch change
1 parent a104b92 commit 5e1deb6

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

internal/mcp/storage/notifier/redis.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,12 @@ func (r *RedisNotifier) Watch(ctx context.Context) (<-chan *config.MCPConfig, er
6464

6565
ch := make(chan *config.MCPConfig, 10)
6666

67-
// Capture the current tail before starting the watch loop so callers do not
68-
// miss updates published immediately after Watch returns.
69-
lastID := "0-0"
70-
latest, err := r.client.XRevRangeN(ctx, r.streamName, "+", "-", 1).Result()
71-
if err != nil && !errors.Is(err, redis.Nil) {
72-
return nil, fmt.Errorf("failed to get stream tail: %w", err)
73-
}
74-
if len(latest) > 0 {
75-
lastID = latest[0].ID
76-
}
77-
7867
go func() {
7968
defer close(ch)
8069

70+
// Start from the latest message ($ means read only new messages)
71+
lastID := "$"
72+
8173
for {
8274
select {
8375
case <-ctx.Done():

0 commit comments

Comments
 (0)