# `Octoroom.Janitor`
[🔗](https://github.com/samrat/octoroom/blob/v0.1.0/lib/octoroom/janitor.ex#L1)

Deletes room records, and what the room's workers saved, whose room
hasn't run for longer than `:room_ttl_ms`:
past that, no resume token can bring the room back, so the record would
only make a new room with the same id think it's recovering.

Workers' Cloudflare sessions need no cleanup: each ends with its peer
connection, including when the node dies.

Options (`config :octoroom, janitor: [...]`):

  * `:enabled` (default true)
  * `:first_sweep_ms`: delay before the first sweep after boot (default
    5 s, so rooms whose clients resume quickly start first)
  * `:interval_ms`: between sweeps (default 60 s)
  * `:room_ttl_ms`: default 10 minutes, the resume token's max age

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

# `sweep`

One sweep. Returns `%{deleted_rooms: [room_id]}`.

Options: `:store`, `:room_ttl_ms`, and `:run_of` (room id => its running
run or nil; defaults to looking up room servers on this node).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
