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

Method DeleteIndex

shock-server/node/node.go:342–357  ·  view source on GitHub ↗
(indextype string)

Source from the content-addressed store, hash-verified

340}
341
342func (node *Node) DeleteIndex(indextype string) (err error) {
343 // lock node
344 err = locker.NodeLockMgr.LockNode(node.Id)
345 if err != nil {
346 return
347 }
348 defer locker.NodeLockMgr.UnlockNode(node.Id)
349
350 delete(node.Indexes, indextype)
351 IndexFilePath := fmt.Sprintf("%s/%s.idx", node.IndexPath(), indextype)
352 if err = os.Remove(IndexFilePath); err != nil {
353 return
354 }
355 err = node.Save()
356 return
357}
358
359func (node *Node) SetIndexInfo(indextype string, idxinfo *IdxInfo) {
360 node.Indexes[indextype] = idxinfo

Callers 1

IndexTypedRequestFunction · 0.80

Calls 5

IndexPathMethod · 0.95
SaveMethod · 0.95
LockNodeMethod · 0.80
UnlockNodeMethod · 0.80
RemoveMethod · 0.45

Tested by

no test coverage detected