-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix static file paths and race conditions (#473)
* fix: Use entrypoint path as static file root when available. * fix(graph): don't spawn tasks in the current runtime * fix: fmt * stamp: typing * stamp(graph): use semaphore to ensure strong count is exactly one --------- Co-authored-by: Nyannyacha <meow@nnc.gg>
- Loading branch information
1 parent
8989dd3
commit 085c61e
Showing
9 changed files
with
65 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
use once_cell::sync::Lazy; | ||
|
||
pub(crate) static SYNC_IO_RT: Lazy<tokio::runtime::Runtime> = Lazy::new(|| { | ||
pub static IO_RT: Lazy<tokio::runtime::Runtime> = Lazy::new(|| { | ||
tokio::runtime::Builder::new_multi_thread() | ||
.enable_all() | ||
.thread_name("sb-virtualfs-io") | ||
.thread_name("io") | ||
.build() | ||
.unwrap() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { join } from 'https://deno.land/std/path/mod.ts'; | ||
|
||
Deno.serve(async (req) => { | ||
if (req.url.endsWith('/foo')) { | ||
return new Response(await Deno.readTextFile(join(import.meta.dirname, 'foo.html'))); | ||
} else { | ||
return new Response(await Deno.readTextFile(join(import.meta.dirname, 'bar.html'))); | ||
} | ||
if (req.url.endsWith('/foo')) { | ||
return new Response(await Deno.readTextFile(new URL('./foo.html', import.meta.url))); | ||
} else { | ||
return new Response(await Deno.readTextFile(new URL('./bar.html', import.meta.url))); | ||
} | ||
}); |