14 lines
380 B
Python
14 lines
380 B
Python
|
|
"""Server-owned admission switch. Reads, synchronization and archival continue."""
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
from app.core.errors import fail
|
||
|
|
|
||
|
|
|
||
|
|
def maintenance_active(settings):
|
||
|
|
return (Path(settings.state_root) / "maintenance").exists()
|
||
|
|
|
||
|
|
|
||
|
|
def require_writable(settings):
|
||
|
|
if maintenance_active(settings):
|
||
|
|
fail(503, "maintenance", "Service is in maintenance mode")
|