diff --git a/docs/readme.md b/docs/readme.md index b39617ea..1e479ba1 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -13,6 +13,7 @@ - [`monitor-states`](#monitor-states) - [`wip`](#wip) - [`stopped`](#stopped) + - [`after-purge`](#after-purge) - [Static functions](#static-functions) - [`string getConstructionPlans(schema)`](#string-getconstructionplansschema) - [`string getMigrationPlans(schema, version)`](#string-getmigrationplansschema-version) @@ -242,6 +243,17 @@ Emitted at most once every 2 seconds when workers are active and jobs are enteri Emitted after `stop()` once all workers have completed their work and maintenance has been shut down. +## `after-purge` + +Emitted after `purge()` gets called from the maintenance job. Only emitted if any archived job was deleted +```js +const boss = new PgBoss(....) +boss.on('after-purge', (jobIds) => { + console.log(jobIds) // ['fc738fb0-1de5-4947-b138-40d6a790749e'] +}) + +``` + # Static functions The following static functions are not required during normal operations, but are intended to assist in schema creation or migration if run-time privileges do not allow schema changes.