fix: use .primary file for primary detection in LiteFS 0.5
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 50s

This commit is contained in:
2026-02-07 18:21:57 -08:00
parent 99d9e00fc9
commit dec669e89b

View File

@@ -47,7 +47,9 @@ echo "Starting Consul registration loop..."
LAST_STATE="unknown" LAST_STATE="unknown"
while true; do while true; do
if /usr/local/bin/litefs is-primary; then # In LiteFS 0.5, .primary file exists ONLY on replicas.
# We check /data/.primary because /data is our mount point.
if [ ! -f /data/.primary ]; then
CURRENT_STATE="primary" CURRENT_STATE="primary"
else else
CURRENT_STATE="replica" CURRENT_STATE="replica"