fastify-citgm
Advanced tools
Comparing version 4.23.2-dev-13 to 4.23.2-dev-14
'use strict' | ||
const VERSION = '4.23.2-dev-13' | ||
const VERSION = '4.23.2-dev-14' | ||
@@ -5,0 +5,0 @@ const Avvio = require('avvio') |
{ | ||
"name": "fastify-citgm", | ||
"version": "4.23.2-dev-13", | ||
"version": "4.23.2-dev-14", | ||
"description": "Fast and low overhead web framework, for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "fastify.js", |
@@ -161,12 +161,17 @@ 'use strict' | ||
t.teardown(() => { | ||
if (!process.env.CITGM) { | ||
// cleanup the file after sonic-boom closed | ||
// otherwise we may face racing condition | ||
fastify.log[streamSym].once('close', cleanup) | ||
// we must flush the stream ourself | ||
// otherwise buffer may whole sonic-boom | ||
fastify.log[streamSym].flushSync() | ||
// end after flushing to actually close file | ||
fastify.log[streamSym].end() | ||
} | ||
setTimeout(() => { | ||
// may fail on win | ||
try { | ||
// cleanup the file after sonic-boom closed | ||
// otherwise we may face racing condition | ||
fastify.log[streamSym].once('close', cleanup) | ||
// we must flush the stream ourself | ||
// otherwise buffer may whole sonic-boom | ||
fastify.log[streamSym].flushSync() | ||
// end after flushing to actually close file | ||
fastify.log[streamSym].end() | ||
} catch (err) { | ||
console.warn(err) | ||
} | ||
}, 500) | ||
}) | ||
@@ -173,0 +178,0 @@ t.teardown(fastify.close.bind(fastify)) |
2331862
56924
4