diff --git a/backend/src/password/EncryptionWorker.d.ts b/backend/src/password/EncryptionWorker.d.ts index f97c4cc12..189f10dff 100644 --- a/backend/src/password/EncryptionWorker.d.ts +++ b/backend/src/password/EncryptionWorker.d.ts @@ -1,7 +1,6 @@ - export function SecretKeyCryptographyCreateKeyFunc( salt: string, password: string, configLoginAppSecret: Buffer, - configLoginServerKey: Buffer -): bigint; \ No newline at end of file + configLoginServerKey: Buffer, +): bigint diff --git a/backend/src/password/EncryptorUtils.ts b/backend/src/password/EncryptorUtils.ts index 8e8e22495..7da8bc9c1 100644 --- a/backend/src/password/EncryptorUtils.ts +++ b/backend/src/password/EncryptorUtils.ts @@ -20,10 +20,9 @@ const configLoginServerKey = Buffer.from(CONFIG.LOGIN_SERVER_KEY, 'hex') let encryptionWorkerPool: Pool | undefined if (CONFIG.USE_CRYPTO_WORKER === true) { - encryptionWorkerPool = pool( - path.join(__dirname, 'worker.js'), - { maxQueueSize: 30 * cpus().length }, - ) + encryptionWorkerPool = pool(path.join(__dirname, 'worker.js'), { + maxQueueSize: 30 * cpus().length, + }) } // We will reuse this for changePassword diff --git a/backend/src/password/worker.js b/backend/src/password/worker.js index 3ba062313..2c1b911f8 100644 --- a/backend/src/password/worker.js +++ b/backend/src/password/worker.js @@ -4,4 +4,3 @@ const { SecretKeyCryptographyCreateKeyFunc } = require('./EncryptionWorker') worker({ SecretKeyCryptographyCreateKeyFunc, }) - diff --git a/backend/src/typeorm/DBVersion.ts b/backend/src/typeorm/DBVersion.ts index 6eaa7fb07..6ce3ac293 100644 --- a/backend/src/typeorm/DBVersion.ts +++ b/backend/src/typeorm/DBVersion.ts @@ -20,10 +20,12 @@ async function checkDBVersionUntil(maxRetries = 15, delayMs = 500): Promise setTimeout(resolve, delayMs)) + await new Promise((resolve) => setTimeout(resolve, delayMs)) } - logger.fatal(`Fatal: Could not connect to database or version check failed after ${maxRetries} attempts.`) + logger.fatal( + `Fatal: Could not connect to database or version check failed after ${maxRetries} attempts.`, + ) throw new Error('Fatal: Database not ready.') } diff --git a/database/src/prepare.ts b/database/src/prepare.ts index 2b9d5682d..9e4bfe1e1 100644 --- a/database/src/prepare.ts +++ b/database/src/prepare.ts @@ -11,7 +11,10 @@ export enum DatabaseState { SAME_VERSION = 'SAME_VERSION', } -export async function connectToDatabaseServer(maxRetries = 15, delayMs = 500): Promise { +export async function connectToDatabaseServer( + maxRetries = 15, + delayMs = 500, +): Promise { for (let attempt = 1; attempt <= maxRetries; attempt++) { try { return await createConnection({ @@ -24,7 +27,7 @@ export async function connectToDatabaseServer(maxRetries = 15, delayMs = 500): P // biome-ignore lint/suspicious/noConsole: no logger present console.log(`could not connect to database server, retry in ${delayMs} ms`, e) } - await new Promise(resolve => setTimeout(resolve, delayMs)) + await new Promise((resolve) => setTimeout(resolve, delayMs)) } return null } diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 083137762..ce7d92ff7 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -20,12 +20,7 @@ then bun install --global turbo fi -# helper functions -log_step() { - local message="$1" - echo -e "\e[34m$message\e[0m" > /dev/tty # blue in console - echo "

$message

" >> "$UPDATE_HTML" # blue in html -} + # check for parameter FAST_MODE=false @@ -54,15 +49,6 @@ fi BRANCH_NAME="$1" -# Debug-Ausgabe -if [ -z "$1" ]; then - echo "Usage: Please provide a branch name as the first argument." - exit 1 -fi -log_step "Use branch: $BRANCH_NAME" -if [ "$FAST_MODE" = true ] ; then - log_step "Use fast mode, keep packet manager, turbo and build cache" -fi # Find current directory & configure paths set -o allexport SCRIPT_PATH=$(realpath $0) @@ -73,6 +59,23 @@ PROJECT_ROOT=$SCRIPT_DIR/../.. NGINX_CONFIG_DIR=$SCRIPT_DIR/nginx/sites-available set +o allexport +# helper functions +log_step() { + local message="$1" + echo -e "\e[34m$message\e[0m" > /dev/tty # blue in console + echo "

$message

" >> "$UPDATE_HTML" # blue in html +} + +# Debug-Ausgabe +if [ -z "$1" ]; then + echo "Usage: Please provide a branch name as the first argument." + exit 1 +fi +log_step "Use branch: $BRANCH_NAME" +if [ "$FAST_MODE" = true ] ; then + log_step "Use fast mode, keep packet manager, turbo and build cache" +fi + # enable nvm export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" nvm use default diff --git a/dht-node/src/typeorm/DBVersion.ts b/dht-node/src/typeorm/DBVersion.ts index 0cd7c0ea5..ee97c3c0a 100644 --- a/dht-node/src/typeorm/DBVersion.ts +++ b/dht-node/src/typeorm/DBVersion.ts @@ -20,10 +20,12 @@ async function checkDBVersionUntil(maxRetries = 15, delayMs = 500): Promise setTimeout(resolve, delayMs)) + await new Promise((resolve) => setTimeout(resolve, delayMs)) } - logger.fatal(`Fatal: Could not connect to database or version check failed after ${maxRetries} attempts.`) + logger.fatal( + `Fatal: Could not connect to database or version check failed after ${maxRetries} attempts.`, + ) throw new Error('Fatal: Database not ready.') } diff --git a/federation/src/server/createServer.ts b/federation/src/server/createServer.ts index 5971a26be..d3df01e18 100644 --- a/federation/src/server/createServer.ts +++ b/federation/src/server/createServer.ts @@ -10,7 +10,6 @@ import cors from './cors' // import serverContext from './context' import { plugins } from './plugins' - // graphql import { schema } from '@/graphql/schema' diff --git a/federation/src/typeorm/DBVersion.ts b/federation/src/typeorm/DBVersion.ts index a8d49b7cc..ed907d2d8 100644 --- a/federation/src/typeorm/DBVersion.ts +++ b/federation/src/typeorm/DBVersion.ts @@ -18,10 +18,12 @@ async function checkDBVersionUntil(maxRetries = 15, delayMs = 500): Promise setTimeout(resolve, delayMs)) + await new Promise((resolve) => setTimeout(resolve, delayMs)) } - logger.fatal(`Fatal: Could not connect to database or version check failed after ${maxRetries} attempts.`) + logger.fatal( + `Fatal: Could not connect to database or version check failed after ${maxRetries} attempts.`, + ) throw new Error('Fatal: Database not ready.') }