mikser-io-post-email 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -252,22 +252,20 @@ export function postEmail(config = {}) {
|
|
|
252
252
|
}
|
|
253
253
|
})
|
|
254
254
|
|
|
255
|
+
// No `teardown` in the descriptor — deliberately. The engine calls
|
|
256
|
+
// a postprocessor's teardown in a `finally` at the END OF EVERY
|
|
257
|
+
// postprocess phase (once per cycle), which is right for plugins
|
|
258
|
+
// that acquire per-cycle resources in a matching setup() (post-pdf's
|
|
259
|
+
// Puppeteer browser). This plugin's `transport` + `drainTimer` are
|
|
260
|
+
// PROCESS-LIFETIME — created once at onLoaded, no setup() to
|
|
261
|
+
// recreate them — so a per-cycle teardown would null the transport
|
|
262
|
+
// after the first cycle and every subsequent send would crash on a
|
|
263
|
+
// null handle. Both resources die cleanly at process exit
|
|
264
|
+
// (drainTimer is unref'd; the socket closes with the process).
|
|
255
265
|
return {
|
|
256
266
|
name: config.name ?? 'email',
|
|
257
267
|
output,
|
|
258
268
|
options: config,
|
|
259
269
|
postprocess,
|
|
260
|
-
teardown,
|
|
261
270
|
}
|
|
262
271
|
}
|
|
263
|
-
|
|
264
|
-
export async function teardown() {
|
|
265
|
-
if (drainTimer) {
|
|
266
|
-
clearInterval(drainTimer)
|
|
267
|
-
drainTimer = null
|
|
268
|
-
}
|
|
269
|
-
if (transport?.close) {
|
|
270
|
-
try { transport.close() } catch { /* not all transports expose close */ }
|
|
271
|
-
}
|
|
272
|
-
transport = null
|
|
273
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mikser-io-post-email",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Email postprocessor for mikser-io — sends rendered output via SMTP and writes .eml audit files. Composes after post-mjml in a chain.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|