mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Saving questions
This commit is contained in:
parent
8d2bc709f3
commit
2998239344
3 changed files with 86 additions and 27 deletions
src/utils
|
@ -296,7 +296,7 @@ export function loadJSON(
|
|||
dataDir: string
|
||||
): Array<QuestionDb> {
|
||||
return dataFiles.reduce((acc, dataFile, index) => {
|
||||
const dataPath = dataDir + dataFile.path
|
||||
const dataPath = dataDir + '/' + dataFile.path
|
||||
|
||||
if (!utils.FileExists(dataPath)) {
|
||||
utils.WriteFile(JSON.stringify([]), dataPath)
|
||||
|
|
|
@ -93,9 +93,9 @@ function getAWorker(i, initData) {
|
|||
// logger.Log(`[MAIN]: Msg from worker #${i}`, msg)
|
||||
// })
|
||||
|
||||
worker.on('online', () => {
|
||||
logger.Log(`[THREAD #${i}]: Worker ${i} online`)
|
||||
})
|
||||
// worker.on('online', () => {
|
||||
// logger.Log(`[THREAD #${i}]: Worker ${i} online`)
|
||||
// })
|
||||
|
||||
worker.on('error', (err) => {
|
||||
logger.Log('Worker error!', logger.GetColor('redbg'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue