File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const getBlockInfo = async (req: Request, res: Response) => {
2323 } ) ;
2424
2525 if ( ! latestBlock ) {
26+ console . log ( "Unable to retrieve the latest block information from the database." ) ;
2627 return res . status ( 500 ) . json ( {
2728 message :
2829 "Unable to retrieve the latest block information from the database." ,
@@ -38,14 +39,16 @@ const getBlockInfo = async (req: Request, res: Response) => {
3839 const timeDiff = secondsSince ( blockInfo . blockTime ) ;
3940
4041 if ( timeDiff > 300 ) {
41- return res . status ( 503 ) . json ( {
42+ const body = {
4243 status : "Service Unavailable" ,
4344 details : {
4445 ...blockInfo ,
4546 currentTime : new Date ( ) . toISOString ( ) ,
4647 secondsSinceLastUpdate : timeDiff ,
4748 } ,
48- } ) ;
49+ }
50+ console . log ( `DbSync BlockTimeDifferenceError: ${ body } ` ) ;
51+ return res . status ( 503 ) . json ( body ) ;
4952 }
5053
5154 return res . status ( 200 ) . json ( {
You can’t perform that action at this time.
0 commit comments