Merge pull request #9726 from owncloud/fix-natjskvregistry

fix unmarshaling
This commit is contained in:
Michael Barz
2024-08-02 13:29:31 +02:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
@@ -2,4 +2,5 @@ Bugfix: Repair nats-js-kv registry
The registry would always send traffic to only one pod. This is now fixed and load should be spread evenly. Also implements watcher method so the cache can use it.
https://github.com/owncloud/ocis/pull/9726
https://github.com/owncloud/ocis/pull/9656
+4 -3
View File
@@ -47,13 +47,14 @@ func (w *Watcher) Next() (*registry.Result, error) {
return nil, errors.New("watcher stopped")
}
var svc *registry.Service
if err := json.Unmarshal(kve.Value.Data, svc); err != nil {
var svc registry.Service
if err := json.Unmarshal(kve.Value.Data, &svc); err != nil {
_ = w.stop()
return nil, err
}
return &registry.Result{
Service: svc,
Service: &svc,
Action: kve.Action,
}, nil
}