Skip to content

Commit

Permalink
Revert "WIP: worker stuff"
Browse files Browse the repository at this point in the history
This reverts commit 163a0ab.
  • Loading branch information
achou11 committed Mar 8, 2023
1 parent e7c7697 commit 4106593
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions src/renderer/components/MapFilter/ReportView/renderReport.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import api from '../../../new-api'

const reportWorker = new Worker('./reportWorker.bundle.js', { type: 'module' })

const reportWorker = new Worker('./pdfWorker.bundle.js', { type: 'module' })
let msgId = 1
const pending = new Map()

// $FlowFixMe
reportWorker.addEventListener('message', msg => {
console.log('MESSAGE', msg)
const { id, buffer, index } = msg.data
if (!id || !pending.has(id)) return
const resolve = pending.get(id)
Expand All @@ -16,14 +14,6 @@ reportWorker.addEventListener('message', msg => {
resolve({ blob: new Blob([buffer], { type: 'application/pdf' }), index })
})

reportWorker.addEventListener('error', err => {
console.log('ERROR RETURNED FROM WORKER', err)
})

reportWorker.addEventListener('messageerror', err => {
console.log('MESSAGEERROR RETURNED FROM WORKER', err)
})

export default function renderReport (
{ observations, getPreset, getMedia, intl, ...otherProps },
timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { PDFReport } from './PDFReport'

const queue = new PQueue({ concurrency: 1 })

console.log('I AM THE WORKER')

function renderToStream (doc) {
return queue.add(() => {
const instance = pdf(doc)
Expand Down

0 comments on commit 4106593

Please sign in to comment.