2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { fastify , FastifyInstance , FastifyServerOptions } from 'fastify'
2
-
3
- import FastifyMetrics from 'fastify-metrics'
2
+ import fastifyMetrics from 'fastify-metrics'
4
3
5
4
export function build ( opts : FastifyServerOptions = { } ) : FastifyInstance {
6
5
const app = fastify ( opts )
7
- // @ts -ignore fastify-metrics doesn't work with NodeNext resolution
8
- app . register ( FastifyMetrics , {
6
+ app . register ( fastifyMetrics . default , {
9
7
endpoint : '/metrics' ,
10
8
routeMetrics : { enabled : false } ,
11
9
} )
Original file line number Diff line number Diff line change @@ -158,9 +158,15 @@ if (EXPORT_DOCS) {
158
158
app . log . error ( err )
159
159
}
160
160
await app . close ( )
161
+ await adminApp . close ( )
161
162
} )
162
163
app . addHook ( 'onClose' , async ( ) => {
163
164
closeListeners . uninstall ( )
165
+ await adminApp . close ( )
166
+ } )
167
+ adminApp . addHook ( 'onClose' , async ( ) => {
168
+ closeListeners . uninstall ( )
169
+ await app . close ( )
164
170
} )
165
171
166
172
app . listen ( { port : PG_META_PORT , host : PG_META_HOST } , ( err ) => {
0 commit comments