forked from mtusi2026/mtusi2026lab4
cron и фикс бага с пнг + защила filer
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
interval=${RECONCILE_INTERVAL_SECONDS:-900}
|
||||
grace=${RECONCILE_GRACE_SECONDS:-3600}
|
||||
|
||||
case "$interval" in
|
||||
''|*[!0-9]*)
|
||||
echo "RECONCILE_INTERVAL_SECONDS must be an integer" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
case "$grace" in
|
||||
''|*[!0-9]*)
|
||||
echo "RECONCILE_GRACE_SECONDS must be an integer" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
if [ "$interval" -lt 60 ]; then
|
||||
echo "RECONCILE_INTERVAL_SECONDS must be at least 60" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [ "$grace" -lt 60 ]; then
|
||||
echo "RECONCILE_GRACE_SECONDS must be at least 60" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
while :
|
||||
do
|
||||
python3 src/reconcile.py --grace-seconds "$grace" --apply
|
||||
sleep "$interval"
|
||||
done
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
docker compose restart postgres s3
|
||||
docker compose up -d --wait postgres s3
|
||||
docker compose restart postgres s3-core
|
||||
docker compose up -d --wait postgres s3-core
|
||||
docker compose restart s3
|
||||
docker compose up -d --wait s3
|
||||
attempt=0
|
||||
until docker compose exec --index 1 -T api python3 -c 'from src.object_store import ObjectStore; store = ObjectStore(); key, _ = next(store.objects()); store.get(key, 10485760)' >/dev/null 2>&1; do
|
||||
attempt=$((attempt + 1))
|
||||
|
||||
Reference in New Issue
Block a user