9 Keepstore initiates trash worker channel goroutine.
10 The channel will process trash list.
11 For each (next) trash request:
12 Delete the block indicated by the trash request Locator
16 func RunTrashWorker(trashq *WorkQueue) {
17 for item := range trashq.NextItem {
18 trashRequest := item.(TrashRequest)
19 TrashItem(trashRequest)
23 // TrashItem deletes the indicated block from every writable volume.
24 func TrashItem(trashRequest TrashRequest) {
25 reqMtime := time.Unix(trashRequest.BlockMtime, 0)
26 if time.Since(reqMtime) < blob_signature_ttl {
27 log.Printf("WARNING: data manager asked to delete a %v old block %v (BlockMtime %d = %v), but my blob_signature_ttl is %v! Skipping.",
30 trashRequest.BlockMtime,
35 for _, volume := range KeepVM.AllWritable() {
36 mtime, err := volume.Mtime(trashRequest.Locator)
37 if err != nil || trashRequest.BlockMtime != mtime.Unix() {
40 err = volume.Delete(trashRequest.Locator)
42 log.Printf("%v Delete(%v): %v", volume, trashRequest.Locator, err)
45 log.Printf("%v Delete(%v) OK", volume, trashRequest.Locator)