@@ -20,6 +20,7 @@ import panda from "./hooks/panda";
2020import persona from "./hooks/persona" ;
2121import androidFingerprints from "./utils/android/fingerprints" ;
2222import appOrigin from "./utils/appOrigin" ;
23+ import { closeQueue , reminders } from "./utils/maturity" ;
2324import { close as closeRedis } from "./utils/redis" ;
2425import { closeAndFlush as closeSegment } from "./utils/segment" ;
2526
@@ -320,7 +321,7 @@ const server = serve(app);
320321export async function close ( ) {
321322 return new Promise ( ( resolve , reject ) => {
322323 server . close ( ( error ) => {
323- Promise . allSettled ( [ closeSentry ( ) , closeRedis ( ) , closeSegment ( ) , database . $client . end ( ) ] )
324+ Promise . allSettled ( [ closeSentry ( ) , closeRedis ( ) , closeSegment ( ) , database . $client . end ( ) , closeQueue ( ) ] )
324325 . then ( ( results ) => {
325326 if ( error ) reject ( error ) ;
326327 else if ( results . some ( ( result ) => result . status === "rejected" ) ) reject ( new Error ( "closing services failed" ) ) ;
@@ -331,6 +332,10 @@ export async function close() {
331332 } ) ;
332333}
333334
335+ reminders ( ) . catch ( ( error : unknown ) => {
336+ captureException ( error , { level : "error" , tags : { unhandled : true } } ) ;
337+ } ) ;
338+
334339if ( ! process . env . VITEST ) {
335340 [ "SIGINT" , "SIGTERM" ] . map ( ( code ) => {
336341 process . on ( code , ( ) => {
0 commit comments