mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
some-random-actions-modification
This commit is contained in:
Submodule modules/qmining/qmining-page updated: 7ac65348e4...ada93f0bb9
Submodule qminingPublic/moodle-test-userscript updated: cbaaa7a376...f8d4bf2a41
@@ -39,10 +39,11 @@ const writeAfter = 1 // write after # of adds FIXME: set reasonable save rate
|
|||||||
var currWrites = 0
|
var currWrites = 0
|
||||||
|
|
||||||
function ProcessIncomingRequest (recievedData, qdb, infos, dryRun) {
|
function ProcessIncomingRequest (recievedData, qdb, infos, dryRun) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
logger.DebugLog('Processing incoming request', 'actions', 1)
|
logger.DebugLog('Processing incoming request', 'actions', 1)
|
||||||
if (recievedData === undefined) {
|
if (recievedData === undefined) {
|
||||||
logger.Log('\tRecieved data is undefined!', logger.GetColor('redbg'))
|
logger.Log('\tRecieved data is undefined!', logger.GetColor('redbg'))
|
||||||
return
|
reject(new Error('Recieved data is undefined!'))
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -140,12 +141,13 @@ function ProcessIncomingRequest (recievedData, qdb, infos, dryRun) {
|
|||||||
logger.DebugLog(allQuestions, 'actions', 2)
|
logger.DebugLog(allQuestions, 'actions', 2)
|
||||||
|
|
||||||
logger.DebugLog('ProcessIncomingRequest done', 'actions', 1)
|
logger.DebugLog('ProcessIncomingRequest done', 'actions', 1)
|
||||||
return allQuestions.length
|
resolve(allQLength.length)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
logger.Log('Couldnt parse JSON data', logger.GetColor('redbg'))
|
logger.Log('Couldnt parse JSON data', logger.GetColor('redbg'))
|
||||||
return -1
|
reject(new Error('Couldnt parse JSON data'))
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// loading stuff
|
// loading stuff
|
||||||
|
Reference in New Issue
Block a user