Skip to content

Maintenance modes

繁體中文 · 简体中文

SoFinder defaults to bounded inline maintenance and therefore does not require cron, systemd or a long-running PHP process. Recycle-bin item and byte limits are always enforced synchronously when an entry is deleted. Opportunity cleanup is separately throttled and protected by non-blocking per-task locks.

yaml
so_finder:
  maintenance:
    mode: inline
    min_interval_seconds: 300
    max_items_per_run: 50
  • inline performs at most the configured number of expired items after a related request and never performs an ordinary full usage scan.
  • messenger dispatches an allowlisted MaintenanceMessage; install Symfony Messenger, route the message to a durable transport and start a consumer before selecting this mode.
  • external performs no request-triggered work. Invoke the Console commands from an operator-managed scheduler.
  • disabled disables opportunity cleanup. Manual commands remain available, and recycle-bin capacity enforcement remains active.
bash
bin/console sofinder:uploads:cleanup
bin/console sofinder:trash:cleanup
bin/console sofinder:usage:recalculate
bin/console sofinder:usage:recalculate --dry-run --json
bin/console sofinder:maintenance:status --json
bin/console sofinder:metadata:repair --dry-run --json
bin/console sofinder:cache:cleanup --dry-run --json

The commands and message handler share the same non-blocking locks. Starting a second copy of the same task safely reports a skip instead of running twice. When cluster.state_service is configured, interval claims, task leases and status are stored in Redis/PDO and shared by every node; otherwise file locks remain the single-node default. Full usage recalculation is intentionally kept out of web requests unless a dirty persisted usage state must be recovered for a quota decision. Task state records queued/running/succeeded/failed status, attempts, timestamps and processed counts. maintenance:status exits non-zero when a task failed. Usage dry-run scans adapters but does not change persisted counters.

Released under the MIT License.