mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-29 00:41:58 +00:00
Merge branch 'main' into refactor/lock-ops-reduction-3810095324988153600
This commit is contained in:
41 files changed
+7794
-241
No files matched your search
+1
-9
@@ -49,15 +49,7 @@ export async function getCompletedAgents(cadence, logDir, deps) {
|
||||
return completed;
|
||||
}
|
||||
|
||||
export function withTimeout(promise, timeoutMs, timeoutMessage) {
|
||||
let timeoutHandle;
|
||||
const timeoutPromise = new Promise((_, reject) => {
|
||||
timeoutHandle = setTimeout(() => reject(new Error(timeoutMessage)), timeoutMs);
|
||||
});
|
||||
return Promise.race([promise, timeoutPromise]).finally(() => {
|
||||
if (timeoutHandle) clearTimeout(timeoutHandle);
|
||||
});
|
||||
}
|
||||
export { withTimeout };
|
||||
|
||||
export function relayListLabel(relays) {
|
||||
return relays.join(', ');
|
||||
|
||||
Reference in new issue
Block a user