Skip to content

Commit

Permalink
Sync Scripts (AbdBarho#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdBarho committed Jan 24, 2023
1 parent 8713163 commit f8de919
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion services/AUTOMATIC1111/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit f8de919

Please sign in to comment.