Timeout for Ping service

pull/786/merge
SergeiTarkhanov 2024-11-13 17:02:42 +03:00 committed by Bastien Wirtz
parent a1c6cb7681
commit b8ec139112
1 changed files with 7 additions and 1 deletions

View File

@ -60,8 +60,14 @@ export default {
} }
const startTime = performance.now(); const startTime = performance.now();
const timeout = parseInt(this.item.timeout, 10) || 2000;
const params = {
method,
cache: "no-cache",
signal: AbortSignal.timeout(timeout)
};
this.fetch("/", { method, cache: "no-cache" }, false) this.fetch("/", params, false)
.then(() => { .then(() => {
this.status = "online"; this.status = "online";
const endTime = performance.now(); const endTime = performance.now();