Skip to content

Commit

Permalink
Use Deno.FsFile.syncDataSync
Browse files Browse the repository at this point in the history
It will be stabilized in Deno v1.44
  • Loading branch information
canac committed May 8, 2024
1 parent c6ee87e commit 781bd0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- name: Run tests (unstable)
run: /home/runner/.deno/bin/deno test --unstable --allow-read --allow-write
- name: Run tests (DENO_FUTURE)
run: DENO_FUTURE=1 /home/runner/.deno/bin/deno test --allow-read --allow-write
- name: Run tests (DENO_FUTURE and unstable)
run: DENO_FUTURE=1 /home/runner/.deno/bin/deno test --unstable --allow-read --allow-write
- name: Run benchmarks
run: /home/runner/.deno/bin/deno run bench.ts
8 changes: 1 addition & 7 deletions build/vfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,7 @@ export default function env(inst) {
// Sync file data to disk
js_sync: (rid) => {
const file = getOpenFile(rid);
if (typeof file.rid === "number") {
// Uses deprecated Deno.FsFile.rid, which will be removed in Deno 2.0
Deno.fdatasyncSync(file.rid);
} else {
// Support DENO_FUTURE, but requires --unstable-fs
file.syncDataSync();
}
file.syncDataSync();
},
// Retrieve the size of the given file
js_size: (rid) => {
Expand Down

0 comments on commit 781bd0a

Please sign in to comment.