mirror of
https://github.com/wassname/talk.git
synced 2026-08-18 12:30:39 +08:00
[CORL-1239] Swap setTimeout for setLongTimeout (#3071)
* fix: ensure user editable time use setLongTimeout * fix: fixed wrong type * fix: fixed snapshots Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent
8aac2d33fc
commit
9d02391062
@@ -1,8 +1,9 @@
|
||||
import AbortController from "abort-controller";
|
||||
import { setLongTimeout } from "long-settimeout";
|
||||
|
||||
function abortAfter(ms: number) {
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => {
|
||||
const timeout = setLongTimeout(() => {
|
||||
controller.abort();
|
||||
}, ms);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import http from "http";
|
||||
import https from "https";
|
||||
import { capitalize } from "lodash";
|
||||
import { clearLongTimeout } from "long-settimeout";
|
||||
import fetch, { RequestInit, Response } from "node-fetch";
|
||||
import { URL } from "url";
|
||||
|
||||
@@ -119,7 +120,7 @@ export const createFetch = ({
|
||||
|
||||
return res;
|
||||
} finally {
|
||||
clearTimeout(abort.timeout);
|
||||
clearLongTimeout(abort.timeout);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user