mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-11-21 04:36:53 -06:00
Chore: Configure pre-commit to format our s6-overlay files (#11414)
This commit is contained in:
@@ -29,5 +29,5 @@ if find /run/s6/container_environment/*"_FILE" -maxdepth 1 > /dev/null 2>&1; the
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "${log_prefix} No *_FILE environment found"
|
||||
echo "${log_prefix} No *_FILE environment found"
|
||||
fi
|
||||
|
||||
@@ -12,24 +12,24 @@ declare -i DELAY=0
|
||||
declare -i STARTED_AT=${EPOCHSECONDS:?EPOCHSECONDS var unset}
|
||||
|
||||
delay_next_attempt() {
|
||||
local -i elapsed=$(( EPOCHSECONDS - STARTED_AT ))
|
||||
local -ri remaining=$(( TIMEOUT - elapsed ))
|
||||
local -i elapsed=$(( EPOCHSECONDS - STARTED_AT ))
|
||||
local -ri remaining=$(( TIMEOUT - elapsed ))
|
||||
|
||||
if (( remaining <= 0 )); then
|
||||
echo "${LOG_PREFIX} Unable to connect after $elapsed seconds."
|
||||
exit 1
|
||||
fi
|
||||
if (( remaining <= 0 )); then
|
||||
echo "${LOG_PREFIX} Unable to connect after $elapsed seconds."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DELAY+=1
|
||||
DELAY+=1
|
||||
|
||||
# clamp to remaining time
|
||||
if (( DELAY > remaining )); then
|
||||
DELAY=$remaining
|
||||
fi
|
||||
# clamp to remaining time
|
||||
if (( DELAY > remaining )); then
|
||||
DELAY=$remaining
|
||||
fi
|
||||
|
||||
ATTEMPT+=1
|
||||
echo "${LOG_PREFIX} Attempt $ATTEMPT failed! Trying again in $DELAY seconds..."
|
||||
sleep "$DELAY"
|
||||
ATTEMPT+=1
|
||||
echo "${LOG_PREFIX} Attempt $ATTEMPT failed! Trying again in $DELAY seconds..."
|
||||
sleep "$DELAY"
|
||||
}
|
||||
|
||||
wait_for_postgres() {
|
||||
@@ -40,7 +40,7 @@ wait_for_postgres() {
|
||||
local -r user="${PAPERLESS_DBUSER:-paperless}"
|
||||
|
||||
while ! pg_isready -h "${host}" -p "${port}" --username "${user}"; do
|
||||
delay_next_attempt
|
||||
delay_next_attempt
|
||||
done
|
||||
echo "${LOG_PREFIX} Connected to PostgreSQL"
|
||||
}
|
||||
@@ -52,7 +52,7 @@ wait_for_mariadb() {
|
||||
local -r port="${PAPERLESS_DBPORT:-3306}"
|
||||
|
||||
while ! mariadb-admin --host="$host" --port="$port" ping --silent >/dev/null 2>&1; do
|
||||
delay_next_attempt
|
||||
delay_next_attempt
|
||||
done
|
||||
echo "${LOG_PREFIX} Connected to MariaDB"
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ export GRANIAN_WORKERS=${GRANIAN_WORKERS:-${PAPERLESS_WEBSERVER_WORKERS:-1}}
|
||||
|
||||
# Only set GRANIAN_URL_PATH_PREFIX if PAPERLESS_FORCE_SCRIPT_NAME is set
|
||||
if [[ -n "${PAPERLESS_FORCE_SCRIPT_NAME}" ]]; then
|
||||
export GRANIAN_URL_PATH_PREFIX=${PAPERLESS_FORCE_SCRIPT_NAME}
|
||||
export GRANIAN_URL_PATH_PREFIX=${PAPERLESS_FORCE_SCRIPT_NAME}
|
||||
fi
|
||||
|
||||
if [[ -n "${USER_IS_NON_ROOT}" ]]; then
|
||||
exec granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
|
||||
exec granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
|
||||
else
|
||||
exec s6-setuidgid paperless granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
|
||||
exec s6-setuidgid paperless granian --interface asginl --ws --loop uvloop "paperless.asgi:application"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user