# Worker — URL Expiry Sweeper

A long-running background process that periodically deletes URL records
past their TTL. Module 1 keeps this **stateless and stdlib-only**; later
modules wire it up to Redis (Lesson 03) and Postgres (Lesson 07).

## What it does

```
loop:
  sweep_once()    # delete expired URL records
  sleep(SWEEP_INTERVAL_SECONDS)
```

In Plan A there's nothing to sweep — `sweep_once` just logs and returns.
The point in Plan A is the **process shape**: a second container next to
the API, sharing config via env vars. Lesson 03 makes the sweep do real
work against the shared Postgres database.

## Configuration

| Env var | Default | Purpose |
|---|---|---|
| `SWEEP_INTERVAL_SECONDS` | `30` | How often to sweep. |
| `LOG_LEVEL` | `info` | Standard Python logging level. |

## Local run

```bash
pip install -r requirements.txt
python worker.py            # runs forever, sweeping every 30s
python worker.py --once     # runs one sweep tick and exits (used in Lesson 03 tests)
```
