Skip to content

Commit

Permalink
fix config parsing for in-memory dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
DocSavage committed Aug 18, 2023
1 parent f8438c8 commit ae1ec07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion datatype/neuronjson/memstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (d *Data) loadMemDB(v dvid.VersionID, mdb *memdb) error {
d.DataName(), v, err)
}
sort.Slice(mdb.ids, func(i, j int) bool { return mdb.ids[i] < mdb.ids[j] })
tlog.Infof("Completed loading of %d annotations into neuronjson instance %q version %s in-memory db",
tlog.Infof("Completed loading of %d annotations into neuronjson instance %q version %d in-memory db",
numLoaded, d.DataName(), v)
return nil
}
Expand Down
18 changes: 12 additions & 6 deletions datatype/neuronjson/neuronjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,12 +1018,18 @@ func (d *Data) Initialize() {
if found {
dvid.Infof("Found configuration for additional in-memory UUIDs for neuronjson %q: %v\n",
d.DataName(), uuidListI)
var ok bool
uuidList, ok = uuidListI.([]string)
if !ok {
dvid.Criticalf("configuration for inmemory dbs for neuronjson %q not a list of UUIDs: %v",
d.DataName(), uuidListI)
return
switch v := uuidListI.(type) {
case []string:
uuidList = v
case []interface{}:
for i, version := range v {
versionStr, ok := version.(string)
if ok {
uuidList = append(uuidList, versionStr)
} else {
dvid.Criticalf("can't parse neuronjson inmemory config for %dth version: %v\n", i, version)
}
}
}
}
if err := d.initMemoryDB(uuidList); err != nil {
Expand Down

0 comments on commit ae1ec07

Please sign in to comment.