Skip to content

Commit

Permalink
Bugfix: Handle client not found error when updating client metadata. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
scudette authored Dec 10, 2024
1 parent f96ea5e commit d2d92bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion services/client_info/housekeep.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,22 @@ func (self *Store) updateClientMetadataIndex(
indexed_fields := config_obj.Defaults.IndexedClientMetadata

// Optionally update the index service.
indexer, _ := services.GetIndexer(config_obj)
indexer, err := services.GetIndexer(config_obj)
if err != nil {
return err
}

// Only update the record if the metadata has changed.
return self.Modify(ctx, config_obj, client_id,
func(client_info *services.ClientInfo) (
*services.ClientInfo, error) {

// Client id is not valid: ignore it. This can happen if
// the client is deleted.
if client_info == nil {
return client_info, nil
}

changed := false

if client_info.Metadata == nil {
Expand Down

0 comments on commit d2d92bb

Please sign in to comment.