p2p submodule split, bug fixes

This commit is contained in:
mrfry
2023-05-03 16:07:45 +02:00
parent 0fea32c204
commit 54c3e1252b
12 changed files with 1426 additions and 995 deletions
@@ -6,8 +6,11 @@ import { RecievedData } from '../../utils/actions'
import { removeCacheFromQuestion } from '../../utils/qdbUtils'
import { QuestionAddResponse } from '../../modules/api/submodules/qminingapi'
import logger from '../../utils/logger'
import { peerToString, loginAndPostDataToAllPeers } from '../../utils/p2putils'
import { post } from '../../utils/networkUtils'
import {
loginAndPostDataToAllPeers,
peerToString,
} from '../../modules/api/p2p/p2putils'
export type QuestionsToPeersTaskObject = {
type: 'sendQuestionsToPeers'
@@ -74,7 +77,11 @@ export const handleQuestionsToPeers = async (
}
}
)
logger.Log(`Peers that added new questions: ${hadNewQuestions.join(', ')}`)
if (hadNewQuestions.length > 0) {
logger.Log(
`\t Peers that added new questions: ${hadNewQuestions.join(', ')}`
)
}
parentPort.postMessage({
msg: `From thread #${workerIndex}: sendQuestionsToPeers done`,