summary refs log tree commit diff
path: root/bundle/src
diff options
context:
space:
mode:
authorSamuel <34555296+Flam3rboy@users.noreply.github.com>2021-10-24 09:05:43 -0400
committerGitHub <noreply@github.com>2021-10-24 09:05:43 -0400
commit7f1bda94928e10545b578fe47785b55c7e1145db (patch)
treeead134c1c0adb2ab0ac0cfbca927f142705e26ef /bundle/src
parentNew translations auth.json (Spanish, Latin America) (diff)
parent:bug: fix locales (diff)
downloadserver-7f1bda94928e10545b578fe47785b55c7e1145db.tar.xz
Merge branch 'master' into translation
Diffstat (limited to 'bundle/src')
-rw-r--r--bundle/src/start.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/bundle/src/start.ts b/bundle/src/start.ts

index ee914b8b..4445fde6 100644 --- a/bundle/src/start.ts +++ b/bundle/src/start.ts
@@ -61,8 +61,12 @@ Current commit: ${ // Fork workers. for (let i = 0; i < cores; i++) { - cluster.fork(); - console.log(`[Process] worker ${i} started.`); + // Delay each worker start if using sqlite database to prevent locking it + let delay = process.env.DATABASE?.includes("://") ? 0 : i * 1000; + setTimeout(() => { + cluster.fork(); + console.log(`[Process] worker ${i} started.`); + }, delay); } cluster.on("message", (sender: Worker, message: any) => {