mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Make worker self.onmessage into classic function
This commit is contained in:
parent
8b15f2580b
commit
ada3aec3f6
1 changed files with 10 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { AppScan } from './scan.mjs'
|
||||
|
||||
self.onmessage = async ( event ) => {
|
||||
self.onmessage = ( event ) => {
|
||||
|
||||
console.log( 'Worker received message', event )
|
||||
|
||||
|
|
@ -24,15 +24,15 @@ self.onmessage = async ( event ) => {
|
|||
}
|
||||
})
|
||||
|
||||
await scan.start()
|
||||
|
||||
|
||||
self.postMessage( {
|
||||
status: 'finished',
|
||||
// Convert App Scan instance to a more primitive Object
|
||||
// so that it's clonneable for our worker
|
||||
scan: JSON.parse(JSON.stringify( scan ))
|
||||
})
|
||||
scan.start()
|
||||
.then( () => {
|
||||
self.postMessage( {
|
||||
status: 'finished',
|
||||
// Convert App Scan instance to a more primitive Object
|
||||
// so that it's clonneable for our worker
|
||||
scan: JSON.parse(JSON.stringify( scan ))
|
||||
})
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue