mirror of
				https://gitlab.com/MrFry/mrfrys-node-server
				synced 2025-04-01 20:24:18 +02:00 
			
		
		
		
	Added some logs, ask test script encodes JSON uri component
This commit is contained in:
		| @@ -23,6 +23,9 @@ elif [ "$#" -eq 2 ]; then | ||||
| fi | ||||
|  | ||||
| ../bin/hr.sh | ||||
|  | ||||
| data=$(node -e "console.log(encodeURIComponent('$data'));") | ||||
|  | ||||
| echo sending | ||||
| echo "Question: $q" | ||||
| echo "Data: $data" | ||||
|   | ||||
| @@ -170,7 +170,7 @@ function ProcessIncomingRequest(recievedData, qdb, infos, dryRun, user) { | ||||
|         }) | ||||
|     } catch (err) { | ||||
|       console.error(err) | ||||
|       logger.Log('Couldnt parse JSON data', logger.GetColor('redbg')) | ||||
|       logger.Log('There was en error handling incoming quiz data, see stderr', logger.GetColor('redbg')) | ||||
|       reject(new Error('Couldnt parse JSON data')) | ||||
|     } | ||||
|   }) | ||||
|   | ||||
| @@ -297,6 +297,7 @@ function searchQuestion(subj, question, questionData, subjName) { | ||||
|       subj.Name, | ||||
|       questionData | ||||
|     ) | ||||
|  | ||||
|     if (percent.avg > minMatchAmmount) { | ||||
|       result.push({ | ||||
|         q: currentQuestion, | ||||
| @@ -405,6 +406,8 @@ function searchData(data, question, subjName, questionData) { | ||||
|     }) | ||||
|  | ||||
|     worker.on('message', (result) => { | ||||
|       logger.DebugLog(`Worker message arrived`, 'worker', 2) | ||||
|       logger.DebugLog(result, 'worker', 3) | ||||
|       logger.DebugLog(`Question result length: ${result.length}`, 'ask', 1) | ||||
|       logger.DebugLog(result, 'ask', 2) | ||||
|  | ||||
| @@ -453,6 +456,7 @@ function dataToString(data) { | ||||
|  | ||||
| // ------------------------------------------------------------------------ | ||||
| if (!isMainThread) { | ||||
|   logger.DebugLog(`Starting search worker ...`, 'worker', 1) | ||||
|   const { data, subjName, question, questionData } = workerData | ||||
|   let result = [] | ||||
|  | ||||
|   | ||||
 Submodule submodules/qmining-data-editor updated: 6bc51fb387...760dfb0c4e
									
								
							
		Reference in New Issue
	
	Block a user