X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f96550cc40f340c79339338d1da81394bfcb64ad..c554b80187e6e076cbf147b1abb34ed9eb36ce93:/services/keepstore/trash_worker.go diff --git a/services/keepstore/trash_worker.go b/services/keepstore/trash_worker.go index 8f78658c3a..62f63d57c8 100644 --- a/services/keepstore/trash_worker.go +++ b/services/keepstore/trash_worker.go @@ -6,14 +6,12 @@ import ( "time" ) -/* - Keepstore initiates trash worker channel goroutine. - The channel will process trash list. - For each (next) trash request: - Delete the block indicated by the trash request Locator - Repeat -*/ - +// RunTrashWorker is used by Keepstore to initiate trash worker channel goroutine. +// The channel will process trash list. +// For each (next) trash request: +// Delete the block indicated by the trash request Locator +// Repeat +// func RunTrashWorker(trashq *WorkQueue) { for item := range trashq.NextItem { trashRequest := item.(TrashRequest) @@ -25,13 +23,13 @@ func RunTrashWorker(trashq *WorkQueue) { // TrashItem deletes the indicated block from every writable volume. func TrashItem(trashRequest TrashRequest) { reqMtime := time.Unix(trashRequest.BlockMtime, 0) - if time.Since(reqMtime) < blob_signature_ttl { - log.Printf("WARNING: data manager asked to delete a %v old block %v (BlockMtime %d = %v), but my blob_signature_ttl is %v! Skipping.", + if time.Since(reqMtime) < blobSignatureTTL { + log.Printf("WARNING: data manager asked to delete a %v old block %v (BlockMtime %d = %v), but my blobSignatureTTL is %v! Skipping.", time.Since(reqMtime), trashRequest.Locator, trashRequest.BlockMtime, reqMtime, - blob_signature_ttl) + blobSignatureTTL) return } @@ -46,10 +44,10 @@ func TrashItem(trashRequest TrashRequest) { continue } - if never_delete { - err = errors.New("did not delete block because never_delete is true") + if neverDelete { + err = errors.New("did not delete block because neverDelete is true") } else { - err = volume.Delete(trashRequest.Locator) + err = volume.Trash(trashRequest.Locator) } if err != nil {