mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-01 17:34:25 +02:00
Increase playground timeout to 15 seconds
We often see timeouts when running the course. Most of the time, the code compiles on the second try, which indicates that we just need to wait a little longer. Fixes #406.
This commit is contained in:
parent
2a2f8ec94e
commit
adc6720031
7
ga4.js
7
ga4.js
@ -43,9 +43,10 @@ window.fetch = async (...args) => {
|
||||
const startTime = window.performance.now();
|
||||
let endTime, errorMessage;
|
||||
try {
|
||||
// The fetch_with_timeout function defaults to a 6000 ms timeout. We use a
|
||||
// slightly shorter timeout so that we can catch and log the error.
|
||||
config.signal = AbortSignal.timeout(5500);
|
||||
// The fetch_with_timeout function from book.js defaults to a 15000 ms
|
||||
// timeout. We use a slightly shorter timeout so that we can catch and log
|
||||
// the error.
|
||||
config.signal = AbortSignal.timeout(14500);
|
||||
let response = await originalFetch(resource, config);
|
||||
payload = await response.json();
|
||||
errorMessage = (payload.error == null) ? null : 'compilation_error';
|
||||
|
2
third_party/mdbook/book.js
vendored
2
third_party/mdbook/book.js
vendored
@ -18,7 +18,7 @@ function playground_text(playground, hidden = true) {
|
||||
}
|
||||
|
||||
(function codeSnippets() {
|
||||
function fetch_with_timeout(url, options, timeout = 6000) {
|
||||
function fetch_with_timeout(url, options, timeout = 15000) {
|
||||
return Promise.race([
|
||||
fetch(url, options),
|
||||
new Promise((_, reject) => setTimeout(() => reject(new Error('timeout')), timeout))
|
||||
|
Loading…
x
Reference in New Issue
Block a user