# IMQOptions.cleanup property · @imqueue/core

Source: https://imqueue.org/api/core/latest/core.imqoptions.cleanup/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/core 3.3.2 — generated reference, not hand-written

Turns on/off the watcher's periodic removal of orphaned keys. Defaults to `false`.

**Signature:**

```typescript
cleanup: boolean;
```

## Remarks

This is a destructive sweep. Only the instance holding the watcher lock performs it, on the [IMQOptions.safeDeliveryTtl](https://imqueue.org/api/core/latest/core.imqoptions.safedeliveryttl/) interval, and it deletes every key under `<prefix>:<cleanupFilter>` that does not belong to a currently connected imq client — with one sweep of grace for clients seen during the previous sweep. That means it will delete messages queued for a consumer that is not running, so enable it only where queue names map one-to-one onto live processes.

