mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 07:43:10 +10:00
fix(printer): increase timeout to 15s
This commit is contained in:
@ -1,11 +1,6 @@
|
||||
export const delay = (time: number) => new Promise((resolve) => setTimeout(resolve, time));
|
||||
|
||||
export const withTimeout = async <T>(promise: Promise<T>, time: number): Promise<T> => {
|
||||
const timeout = new Promise((_, reject) =>
|
||||
setTimeout(() => {
|
||||
reject(new Error(`Operation timed out after ${time} ms.`));
|
||||
}, time),
|
||||
);
|
||||
|
||||
const timeout = new Promise((_, reject) => setTimeout(() => reject, time));
|
||||
return Promise.race([promise, timeout]) as T;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user