Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 587cfffbe4 | |||
| 820811cca2 | |||
| e25271f9db | |||
| 709f9fa894 |
12
changelog.md
12
changelog.md
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-03-23 - 8.0.2 - fix(servicemanager)
|
||||
cancel startup timeout once service initialization completes
|
||||
|
||||
- Replaces the startup timeout race delay with a cancellable Timeout instance
|
||||
- Prevents the global startup timeout from lingering after startup finishes or fails
|
||||
|
||||
## 2026-03-23 - 8.0.1 - fix(servicemanager)
|
||||
cancel shutdown timeouts after services stop
|
||||
|
||||
- Replace the shutdown race delay with a cancellable Timeout in ServiceManager.
|
||||
- Prevent timeout handlers from lingering after a service stops successfully during shutdown.
|
||||
|
||||
## 2026-03-20 - 8.0.0 - BREAKING CHANGE(service)
|
||||
expand service lifecycle management with instance-aware hooks, startup timeouts, labels, readiness waits, and auto-restart support
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@push.rocks/taskbuffer",
|
||||
"version": "8.0.0",
|
||||
"version": "8.0.2",
|
||||
"private": false,
|
||||
"description": "A flexible task management library supporting TypeScript, allowing for task buffering, scheduling, and execution with dependency management.",
|
||||
"main": "dist_ts/index.js",
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/taskbuffer',
|
||||
version: '8.0.0',
|
||||
version: '8.0.2',
|
||||
description: 'A flexible task management library supporting TypeScript, allowing for task buffering, scheduling, and execution with dependency management.'
|
||||
}
|
||||
|
||||
@@ -82,12 +82,15 @@ export class ServiceManager {
|
||||
|
||||
// Enforce global startup timeout
|
||||
if (this.options.startupTimeoutMs) {
|
||||
await Promise.race([
|
||||
startupPromise,
|
||||
plugins.smartdelay.delayFor(this.options.startupTimeoutMs).then(() => {
|
||||
throw new Error(`${this.name}: global startup timeout exceeded (${this.options.startupTimeoutMs}ms)`);
|
||||
}),
|
||||
]);
|
||||
const timeout = new plugins.smartdelay.Timeout(this.options.startupTimeoutMs);
|
||||
const timeoutPromise = timeout.promise.then(() => {
|
||||
throw new Error(`${this.name}: global startup timeout exceeded (${this.options.startupTimeoutMs}ms)`);
|
||||
});
|
||||
try {
|
||||
await Promise.race([startupPromise, timeoutPromise]);
|
||||
} finally {
|
||||
timeout.cancel();
|
||||
}
|
||||
} else {
|
||||
await startupPromise;
|
||||
}
|
||||
@@ -158,12 +161,15 @@ export class ServiceManager {
|
||||
runningInLevel.map(async (name) => {
|
||||
const service = this.services.get(name)!;
|
||||
try {
|
||||
await Promise.race([
|
||||
service.stop(),
|
||||
plugins.smartdelay.delayFor(this.options.shutdownTimeoutMs).then(() => {
|
||||
throw new Error(`Timeout stopping service '${name}'`);
|
||||
}),
|
||||
]);
|
||||
const timeout = new plugins.smartdelay.Timeout(this.options.shutdownTimeoutMs);
|
||||
const timeoutPromise = timeout.promise.then(() => {
|
||||
throw new Error(`Timeout stopping service '${name}'`);
|
||||
});
|
||||
try {
|
||||
await Promise.race([service.stop(), timeoutPromise]);
|
||||
} finally {
|
||||
timeout.cancel();
|
||||
}
|
||||
} catch (err) {
|
||||
logger.log('warn', `${this.name}: error stopping '${name}': ${err instanceof Error ? err.message : String(err)}`);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/taskbuffer',
|
||||
version: '8.0.0',
|
||||
version: '8.0.2',
|
||||
description: 'A flexible task management library supporting TypeScript, allowing for task buffering, scheduling, and execution with dependency management.'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user