mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix lint
This commit is contained in:
parent
503ff978a6
commit
9c2ef4bf2e
5
backend/src/password/EncryptionWorker.d.ts
vendored
5
backend/src/password/EncryptionWorker.d.ts
vendored
@ -1,7 +1,6 @@
|
||||
|
||||
export function SecretKeyCryptographyCreateKeyFunc(
|
||||
salt: string,
|
||||
password: string,
|
||||
configLoginAppSecret: Buffer,
|
||||
configLoginServerKey: Buffer
|
||||
): bigint;
|
||||
configLoginServerKey: Buffer,
|
||||
): bigint
|
||||
|
||||
@ -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
|
||||
|
||||
@ -4,4 +4,3 @@ const { SecretKeyCryptographyCreateKeyFunc } = require('./EncryptionWorker')
|
||||
worker({
|
||||
SecretKeyCryptographyCreateKeyFunc,
|
||||
})
|
||||
|
||||
|
||||
@ -20,10 +20,12 @@ async function checkDBVersionUntil(maxRetries = 15, delayMs = 500): Promise<DbCo
|
||||
} catch (err) {
|
||||
logger.warn(`Attempt ${attempt}: Waiting for DB...`, err)
|
||||
}
|
||||
await new Promise(resolve => 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.')
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,10 @@ export enum DatabaseState {
|
||||
SAME_VERSION = 'SAME_VERSION',
|
||||
}
|
||||
|
||||
export async function connectToDatabaseServer(maxRetries = 15, delayMs = 500): Promise<Connection | null> {
|
||||
export async function connectToDatabaseServer(
|
||||
maxRetries = 15,
|
||||
delayMs = 500,
|
||||
): Promise<Connection | null> {
|
||||
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
|
||||
}
|
||||
|
||||
@ -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 "<p style="color:blue">$message</p>" >> "$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 "<p style="color:blue">$message</p>" >> "$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
|
||||
|
||||
@ -20,10 +20,12 @@ async function checkDBVersionUntil(maxRetries = 15, delayMs = 500): Promise<DbCo
|
||||
} catch (err) {
|
||||
logger.warn(`Attempt ${attempt}: Waiting for DB...`, err)
|
||||
}
|
||||
await new Promise(resolve => 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.')
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ import cors from './cors'
|
||||
// import serverContext from './context'
|
||||
import { plugins } from './plugins'
|
||||
|
||||
|
||||
// graphql
|
||||
import { schema } from '@/graphql/schema'
|
||||
|
||||
|
||||
@ -18,10 +18,12 @@ async function checkDBVersionUntil(maxRetries = 15, delayMs = 500): Promise<DbCo
|
||||
} catch (err) {
|
||||
logger.warn(`Attempt ${attempt}: Waiting for DB...`, err)
|
||||
}
|
||||
await new Promise(resolve => 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.')
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user