Currently when the queue is empty, even after a long time, the file still takes up disk space. We need similar functionality:
func (d *diskQueue) CleanupIfQueueEmpty() error {
d.Lock()
defer d.Unlock()
if d.Depth() == 0 {
return d.Empty()
}
return nil
}