MCPcopy Create free account
hub / github.com/MG-RAST/Shock / ReloadFromDisk

Function ReloadFromDisk

shock-server/node/db.go:131–144  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

129}
130
131func ReloadFromDisk(path string) (err error) {
132 id := filepath.Base(path)
133 nbson, err := ioutil.ReadFile(path + "/" + id + ".bson")
134 if err != nil {
135 return
136 }
137 node := new(Node)
138 if err = bson.Unmarshal(nbson, &node); err == nil {
139 if err = dbUpsert(node); err != nil {
140 return err
141 }
142 }
143 return
144}

Callers

nothing calls this directly

Calls 1

dbUpsertFunction · 0.85

Tested by

no test coverage detected