Remove deletes an indexed object from the engine
(hash string)
| 215 | |
| 216 | // Remove deletes an indexed object from the engine |
| 217 | func (e *Engine) Remove(hash string) error { |
| 218 | if !e.IsIndexed(hash) { |
| 219 | return fmt.Errorf("no document '%s' in index", hash) |
| 220 | } |
| 221 | if e.q.IsStopped() { |
| 222 | e.l.Warnw("queue stopped - waiting and trying again", |
| 223 | "hash", hash) |
| 224 | time.Sleep(3 * time.Second) |
| 225 | } |
| 226 | return e.q.Queue(&queue.Item{Key: hash, Val: nil}) |
| 227 | } |
| 228 | |
| 229 | // Close shuts down the engine |
| 230 | func (e *Engine) Close() { |