servercraft-watchdog-3-consecutive-failures-teardown

Status: IN

Three consecutive unreachable player count polls triggers an emergency backup + teardown sequence.

Source: entries/2026/05/11/servercraft-watchdog.md

Example

# From ftl2-servercraft/watchdog.py
async with automation(...) as ftl:
    consecutive_failures = 0
    while state.watchdog_active:
        count = await script.get_player_count(ftl, config)
        if count is None:
            consecutive_failures += 1
            if consecutive_failures >= 3:
                await script.backup_world(ftl, config, log_callback)
                await script.destroy(ftl, config, log_callback)
                return
        else:
            consecutive_failures = 0
        await asyncio.sleep(config.poll_interval)

JSON