mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2026-04-28 11:17:38 +02:00
Fixed added questions beeing empty arrays, removed some consolelogs
This commit is contained in:
@@ -93,9 +93,9 @@ function ProcessIncomingRequest(recievedData, qdb, infos, dryRun, user) {
|
||||
Promise.all(questionSearchPromises)
|
||||
.then((results) => {
|
||||
const allQuestions = [] // all new questions here that do not have result
|
||||
results.forEach((result) => {
|
||||
results.forEach((result, i) => {
|
||||
if (result.length === 0) {
|
||||
allQuestions.push(result)
|
||||
allQuestions.push(data.quiz[i])
|
||||
}
|
||||
})
|
||||
|
||||
@@ -149,12 +149,9 @@ function ProcessIncomingRequest(recievedData, qdb, infos, dryRun, user) {
|
||||
logger.DebugLog(allQuestions, 'actions', 2)
|
||||
|
||||
logger.DebugLog('ProcessIncomingRequest done', 'actions', 1)
|
||||
resolve({
|
||||
newQuestions: allQLength.length,
|
||||
newDb: qdb,
|
||||
})
|
||||
resolve(allQuestions.length)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
console.error(error)
|
||||
logger.Log(
|
||||
'Error while processing processData worker result!',
|
||||
logger.GetColor('redbg')
|
||||
@@ -172,7 +169,7 @@ function ProcessIncomingRequest(recievedData, qdb, infos, dryRun, user) {
|
||||
console.error(err)
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
console.error(err)
|
||||
logger.Log('Couldnt parse JSON data', logger.GetColor('redbg'))
|
||||
reject(new Error('Couldnt parse JSON data'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user