-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fetch https dependencies with retries (#350)
- Loading branch information
Showing
10 changed files
with
57 additions
and
15 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
Binary file not shown.
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,7 +1,20 @@ | ||
import { createCache } from "https://deno.land/x/deno_cache@0.6.1/mod.ts"; | ||
import { createCache } from "https://deno.land/x/deno_cache@0.6.2/mod.ts"; | ||
|
||
const fileFetcher = createCache(); | ||
|
||
export function fetch_specifier(specifier) { | ||
return fileFetcher.load(new URL(specifier)); | ||
export function fetch_specifier(specifier, cacheSettingVal) { | ||
return fileFetcher.load(new URL(specifier), getCacheSetting(cacheSettingVal)); | ||
} | ||
|
||
function getCacheSetting(val) { | ||
// WARNING: ensure this matches wasm/src/lib.rs | ||
switch (val) { | ||
case 1: | ||
return "use"; | ||
case 2: | ||
return "reload"; | ||
case 0: | ||
default: | ||
return "only"; | ||
} | ||
} |
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,7 +1,20 @@ | ||
import { createCache } from "https://deno.land/x/deno_cache@0.6.1/mod.ts"; | ||
import { createCache } from "https://deno.land/x/deno_cache@0.6.2/mod.ts"; | ||
|
||
const fileFetcher = createCache(); | ||
|
||
export function fetch_specifier(specifier) { | ||
return fileFetcher.load(new URL(specifier)); | ||
export function fetch_specifier(specifier, cacheSettingVal) { | ||
return fileFetcher.load(new URL(specifier), getCacheSetting(cacheSettingVal)); | ||
} | ||
|
||
function getCacheSetting(val) { | ||
// WARNING: ensure this matches wasm/src/lib.rs | ||
switch (val) { | ||
case 1: | ||
return "use"; | ||
case 2: | ||
return "reload"; | ||
case 0: | ||
default: | ||
return "only"; | ||
} | ||
} |
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