This commit is contained in:
Chayapak 2023-08-19 10:48:17 +07:00
parent a3ab6e672f
commit 3d34ad6fea

View file

@ -12,6 +12,8 @@ io.on('connection', (socket) => {
let isFirst = true
let jsonArray
function reset () {
worker = new Worker(path.join(__dirname, 'vm.js'))
@ -36,7 +38,9 @@ io.on('connection', (socket) => {
reset()
socket.on('setFunctions', (jsonArray) => {
socket.on('setFunctions', (_jsonArray) => {
jsonArray = _jsonArray
worker.postMessage({ type: 'setFunctions', jsonArray })
})