Skip to content

Commit

Permalink
Fix Module
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed May 17, 2024
1 parent 07790fe commit 60ad8aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/chat/pyodide-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ self.onmessage = async (event) => {
outputs = []
// see https://github.com/pyodide/pyodide/blob/b177dba277350751f1890279f5d1a9096a87ed13/src/js/api.ts#L546
// sync native ==> browser
await new Promise((resolve, _) => Module.FS.syncfs(true, resolve));
await new Promise((resolve, _) => self.pyodide.FS.syncfs(true, resolve));
await self.pyodide.runPythonAsync("await run(source, io_context)")
// sync browser ==> native
await new Promise((resolve, _) => Module.FS.syncfs(false, resolve)),
await new Promise((resolve, _) => self.pyodide.FS.syncfs(false, resolve)),
console.log("Execution done", outputs)
self.postMessage({ executionDone: true, outputs })
outputs = []
Expand Down

0 comments on commit 60ad8aa

Please sign in to comment.