fix(utils): use smartdelay.Timeout for cancellable timeouts and call timeout.cancel() on cleanup; add @git.zone/cli release configuration pointing to Verdaccio registry with public access

This commit is contained in:
2026-02-11 17:20:34 +00:00
parent e207c05dc3
commit bbfd4982a5
4 changed files with 24 additions and 17 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/webrequest',
version: '4.0.1',
version: '4.0.2',
description: 'Modern, fetch-compatible web request library with intelligent HTTP caching, retry strategies, and fault tolerance.'
}

View File

@@ -12,24 +12,16 @@ export function createTimeoutController(timeoutMs: number): {
cleanup: () => void;
} {
const controller = new AbortController();
let timeoutId: any;
// Set up timeout
plugins.smartdelay
.delayFor(timeoutMs)
.then(() => {
controller.abort();
})
.then((result) => {
timeoutId = result;
});
// Use Timeout directly so we can cancel it when the fetch completes
const timeout = new plugins.smartdelay.Timeout(timeoutMs, null);
timeout.promise.then(() => {
controller.abort();
});
// Cleanup function to clear timeout
// Cleanup function to cancel the timeout timer
const cleanup = () => {
if (timeoutId !== undefined) {
// smartdelay doesn't expose a cancel method, so we just ensure
// the controller won't abort if already completed
}
timeout.cancel();
};
return { controller, cleanup };