change to uuid.NewRandom to avoid panic

Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
This commit is contained in:
akhilac1 2022-09-23 23:20:11 +05:30
parent 3d3864956a
commit 5e58fa4efe
1 changed files with 5 additions and 1 deletions

View File

@ -403,7 +403,11 @@ func (p *ConfigurationStore) subscribeToChannel(ctx context.Context, pgNotifyCha
}
}
stop := make(chan struct{})
subscribeID = uuid.New().String()
subscribeUID, err := uuid.NewRandom()
if err != nil {
return "", fmt.Errorf("unable to generate subscription id - %w", err)
}
subscribeID = subscribeUID.String()
p.subscribeStopChanMap[subscribeID] = stop
p.ActiveSubscriptions[channel] = &subscription{
uuid: subscribeID,