Sync Scripts (#309)

Refs #308
This commit is contained in:
AbdBarho 2023-01-24 23:11:15 +01:00 committed by GitHub
parent 8713163a3c
commit f8de9190ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,6 @@ MOUNTS["${ROOT}/models/Lora"]="/data/Lora"
MOUNTS["${ROOT}/embeddings"]="/data/embeddings"
MOUNTS["${ROOT}/config.json"]="/data/config/auto/config.json"
MOUNTS["${ROOT}/ui-config.json"]="/data/config/auto/ui-config.json"
MOUNTS["${ROOT}/extensions"]="/data/config/auto/extensions"
# extra hacks
MOUNTS["${ROOT}/repositories/CodeFormer/weights/facelib"]="/data/.cache"
@ -55,6 +54,21 @@ for to_path in "${!MOUNTS[@]}"; do
echo Mounted $(basename "${from_path}")
done
sync_bidirectional() {
rsync -cau /data/config/auto/extensions/ "${ROOT}/extensions"
rsync -cau "${ROOT}/extensions/" /data/config/auto/extensions
}
sync_extensions() {
# I don't have any better ideas:
while true; do
set -Eeuo pipefail
sync_bidirectional
sleep 2s
done
}
sync_bidirectional
sync_extensions &
if [ -f "/data/config/auto/startup.sh" ]; then
pushd ${ROOT}
. /data/config/auto/startup.sh