Skip to content

Commit

Permalink
removed systemjs worker logs
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-worker-meta-worker.js,AUTO-COMMIT-src-worker-systemjs-worker.js,
  • Loading branch information
JensLincke committed Nov 15, 2023
1 parent 536cfdb commit 731297b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/worker/meta-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ importScripts("./livelyworker.js")

onmessage = function(evt) {

console.log("metaworker initial onmessage", evt)
// console.log("metaworker initial onmessage", evt)
if (evt.data.message == "load") {
console.log("meta worker load " + evt.data.url)
// console.log("meta worker load " + evt.data.url)
System.import("src/plugin-babel.js").then(() => {
System.import("src/client/preferences.js").then((mod) => {
var Preferences = mod.default
Expand All @@ -23,7 +23,7 @@ onmessage = function(evt) {
System.import(evt.data.url).then((m) => {
postMessage({message: "loaded"})
self.onmessage = async (evt) => {
console.log("metaworker onmessage", evt)
// console.log("metaworker onmessage", evt)

if(m.onrequest && evt.data && evt.data.message === "systemjs-worker-request") {
try {
Expand All @@ -37,13 +37,13 @@ onmessage = function(evt) {
}
}

console.log("metaworker custom onmessage", evt)
// console.log("metaworker custom onmessage", evt)
if (m.onmessage) {
m.onmessage(evt)
}
}
}).catch((err) => {
console.log("meta worker error ", err)
// console.log("meta worker error ", err)
postMessage({message: "error", value: err})
})
})
Expand Down
14 changes: 5 additions & 9 deletions src/worker/systemjs-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ export default class SystemjsWorker {
lively.error("[systemjs-worker]", msg.error || msg.value)
}
if (msg.message == "loaded") {
// console.log("worker loaded", url)

// console.log("worker loaded", url)
/*MD ### Important: here the actual client message is installed MD*/
this.metaworker.onmessage = (evt) => {
console.log("systemjs-worker.js ON MESSAGE", evt)
Expand Down Expand Up @@ -77,7 +76,7 @@ export default class SystemjsWorker {
}

handleRequest(msg) {
console.log("handleRequest ", msg)
// console.log("handleRequest ", msg)
var resolve = this.resolveRequestForId.get(msg.id)
var reject = this.rejectRequestForId.get(msg.id)
if (!resolve) {
Expand All @@ -86,7 +85,7 @@ export default class SystemjsWorker {
this.resolveRequestForId.set(msg.id, null)
this.rejectRequestForId.set(msg.id, null)
if (!msg.error) {
console.log("FINISHED " + msg.id + " in " + (performance.now() - this.startTimeForId.get(msg.id)) + "ms response: " +msg.response )
// console.log("FINISHED " + msg.id + " in " + (performance.now() - this.startTimeForId.get(msg.id)) + "ms response: " +msg.response )
resolve(msg.response)
} else {
reject(msg.error)
Expand All @@ -96,7 +95,7 @@ export default class SystemjsWorker {
async postRequest(...data) {

let id = this.newId()
console.log("POST REQUEST " + id)
// console.log("POST REQUEST " + id)
this.startTimeForId.set(id, performance.now())
let promise = new Promise((resolve, reject) => {
this.resolveRequestForId.set(id, resolve)
Expand All @@ -108,11 +107,8 @@ export default class SystemjsWorker {
setTimeout(() => {
var unhandledRequestResolve = this.resolveRequestForId.get(id)
if (unhandledRequestResolve) {
console.log("TIMEOUT! " + id)
reject( "request timeout after " + (performance.now() - start) + "ms")
} else {
console.log("NOOO TIMEOUT!" + id)
}
}
}, this.timeout)
}
})
Expand Down

0 comments on commit 731297b

Please sign in to comment.