sending new users to peers on user creation

This commit is contained in:
mrfry 2023-04-29 09:59:39 +02:00
parent 2f24f214b2
commit cb0ad03336
9 changed files with 351 additions and 172 deletions

View file

@ -12,6 +12,7 @@ import { handleNewDb } from './handlers/handleNewDb'
import { handleDbClean } from './handlers/handleDbClean'
import { handleQuestionsToPeers } from './handlers/handleQuestionsToPeers'
import { handleRmQuestions } from './handlers/handleRmQuestions'
import { handleUsersToPeers } from './handlers/handleUsersToPeers'
export interface WorkerResult {
msg: string
@ -81,6 +82,8 @@ async function handleMessage(
await handleRmQuestions(qdbs, msg, workerIndex, setQdbs)
} else if (msg.type === 'sendQuestionsToPeers') {
await handleQuestionsToPeers(qdbs, msg, workerIndex)
} else if (msg.type === 'sendUsersToPeers') {
await handleUsersToPeers(qdbs, msg, workerIndex)
} else {
logger.Log(`Invalid msg type!`, logger.GetColor('redbg'))
console.error(msg)