Fix indentation and formatting issues in bunkerweb-scheduler.sh and entrypoint.sh

This commit is contained in:
Théophile Diot 2025-01-14 18:15:48 +01:00
parent 159c9475f3
commit 788c2c56bc
No known key found for this signature in database
GPG key ID: FA995104A0BA376A
2 changed files with 14 additions and 14 deletions

View file

@ -109,15 +109,15 @@ with db.sql_engine.connect() as conn:
result = conn.execute(sa.text('SELECT version FROM bw_metadata WHERE id = 1'))
print(next(result)[0])
except BaseException as e:
if 'doesn\'t exist' not in str(e) and 'no such table' not in str(e) and 'relation \"bw_metadata\" does not exist' not in str(e):
if "doesn't exist" not in str(e) and "no such table" not in str(e) and 'relation "bw_metadata" does not exist' not in str(e):
with open('/var/tmp/bunkerweb/database_error', 'w') as file:
file.write(str(e))
file.write(str(e))
print('none')
else:
print('${installed_version}')
with open('/var/tmp/bunkerweb/database_uri', 'w') as file:
file.write(db.database_uri)
file.write(db.database_uri)
EOL
current_version=$(sudo -E -u nginx -g nginx /bin/bash -c "PYTHONPATH=$PYTHONPATH python3 /tmp/version_check.py")

View file

@ -72,19 +72,19 @@ LOGGER = setup_logger('Scheduler', getenv('CUSTOM_LOG_LEVEL', getenv('LOG_LEVEL'
db = Database(LOGGER)
with db.sql_engine.connect() as conn:
try:
result = conn.execute(sa.text('SELECT version FROM bw_metadata WHERE id = 1'))
print(next(result)[0])
except BaseException as e:
if 'doesn\'t exist' not in str(e) and 'no such table' not in str(e) and 'relation \"bw_metadata\" does not exist' not in str(e):
with open('/var/tmp/bunkerweb/database_error', 'w') as file:
file.write(str(e))
print('none')
else:
print('${installed_version}')
try:
result = conn.execute(sa.text('SELECT version FROM bw_metadata WHERE id = 1'))
print(next(result)[0])
except BaseException as e:
if \"doesn't exist\" not in str(e) and \"no such table\" not in str(e) and 'relation \"bw_metadata\" does not exist' not in str(e):
with open('/var/tmp/bunkerweb/database_error', 'w') as file:
file.write(str(e))
print('none')
else:
print('${installed_version}')
with open('/var/tmp/bunkerweb/database_uri', 'w') as file:
file.write(db.database_uri)
file.write(db.database_uri)
")
if [ "$current_version" == "none" ]; then