Skip to content

Commit

Permalink
removed uuid perform file system checks instead
Browse files Browse the repository at this point in the history
  • Loading branch information
trbKnl committed Oct 25, 2023
1 parent 23f19a9 commit cd0d14a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/framework/processing/py_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ function unwrap(response) {
}

function copyFileToPyFS(file, resolve) {
directoryName = `/file-input${crypto.randomUUID()}`
self.pyodide.FS.mkdir(directoryName)
directoryName = `/file-input`
pathStats = self.pyodide.FS.analyzePath(directoryName)
if (!pathStats.exists) {
self.pyodide.FS.mkdir(directoryName)
} else {
self.pyodide.FS.unmount(directoryName)
}
self.pyodide.FS.mount(
self.pyodide.FS.filesystems.WORKERFS,
{
Expand Down

0 comments on commit cd0d14a

Please sign in to comment.