Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs: correct the shutdown budget and voice note waveform notes
Yudhi Armyndhariscab23a0681de
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdindex 34d5f16c9..284f76cea 100644--- a/docs/06-api-specification.md+++ b/docs/06-api-specification.md@@ -1963,7 +1963,7 @@ Send a video (by URL or base64) with an optional caption. Uses the same `SendMed#### POST /api/sessions/:sessionId/messages/send-audio-Send an audio message (by URL or base64). Uses `SendAudioMessageDto`. A `caption` is accepted by the DTO but not persisted for audio. Set `ptt: true` to send a real WhatsApp **voice note** (microphone bubble + waveform) instead of a plain audio file. `ptt` is a JSON boolean, exclusive to this endpoint and to `audio` items of `send-bulk`, and — because voice notes require `audio/ogg; codecs=opus` — the server defaults the mimetype to that when you set `ptt` without one; for reliable playback (especially on the Baileys engine, which does not transcode) supply OGG/Opus bytes. A `ptt` voice note is stored as message `type: "voice"`. On the Baileys engine its waveform is read through ffmpeg (`FFMPEG_PATH`, also with media conversion disabled), at most the first 35 minutes of it, and a note whose waveform cannot be read goes out with flat bars; the duration is read in a separate process and is `0` when it cannot be read.+Send an audio message (by URL or base64). Uses `SendAudioMessageDto`. A `caption` is accepted by the DTO but not persisted for audio. Set `ptt: true` to send a real WhatsApp **voice note** (microphone bubble + waveform) instead of a plain audio file. `ptt` is a JSON boolean, exclusive to this endpoint and to `audio` items of `send-bulk`, and — because voice notes require `audio/ogg; codecs=opus` — the server defaults the mimetype to that when you set `ptt` without one; for reliable playback (especially on the Baileys engine, which does not transcode) supply OGG/Opus bytes. A `ptt` voice note is stored as message `type: "voice"`. On the Baileys engine its waveform is read through ffmpeg (`FFMPEG_PATH`, also with media conversion disabled); a note of more than about 35 minutes, or one whose waveform cannot be read, goes out with flat bars. The duration is read in a separate process and is `0` when it cannot be read.**Auth:** API key (OPERATOR)diff --git a/src/common/services/shutdown-budget.ts b/src/common/services/shutdown-budget.tsindex b8167ddc7..f8a05dc6e 100644--- a/src/common/services/shutdown-budget.ts+++ b/src/common/services/shutdown-budget.ts@@ -25,7 +25,7 @@** The teardown after the grace has SHUTDOWN_TEARDOWN_LIMIT_MS (67 s), against 60 s of stages in the* clustered case. The 7 s left over is the reserve for the waits that have no cap of their own, before- * and after the HTTP close: the database and plugin hook waits listed at the end, the BullModule+ * and after the HTTP close: the database waits listed at the end, the BullModule* re-await of the worker close (closeWorkerIfStarted settles it once its cap is hit), the DataSource* close and the ffmpeg kill. They take milliseconds when nothing is wedged.*@@ -53,6 +53,11 @@* not awaited) and the session ownership release. They wait on the database. A wedged database ends the* stop at the force-exit, with status 1, before the kill; the stages behind these waits (worker close,* usage flush, plugin onDisable) get only the time that is left.+ *+ * One database does not stay inside that bound: SQLite. better-sqlite3 waits for a lock held by another+ * process synchronously, up to SQLITE_BUSY_TIMEOUT_MS (30 s) a write, and the event loop is blocked+ * meanwhile, so neither the grace timer nor the force-exit can run. A lock held past the kill deadline+ * (a backup or another tool opening the data file) ends in the orchestrator's SIGKILL, with no hook run.*//** Grace before teardown, so a load balancer sees the 503 first. SHUTDOWN_DELAY_MS overrides it. */