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
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 50s
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user