File tree Expand file tree Collapse file tree
services/aws-lambda-scan-html/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,22 +126,25 @@ export default async function (job: SqsScanJob) {
126126
127127 // TODO integrate equalify format conversion
128128
129- await shutdown ( browser ) . then ( ( ) => {
129+ const readyToExit = await shutdown ( browser ) . then ( ( val ) => {
130130 logger . info ( `HTML Scanner: Job [${ job . id } ] - Browser shutdown.` ) ;
131+ return val ;
131132 } ) ;
132- return {
133- createdDate : new Date ( ) , // record to add
134- axeresults : results ,
135- jobID : job . id ,
136- //editoria11yResults: editoria11yResults,
137- } ;
133+ if ( readyToExit ) {
134+ return {
135+ createdDate : new Date ( ) , // record to add
136+ axeresults : results ,
137+ jobID : job . id ,
138+ //editoria11yResults: editoria11yResults,
139+ } ;
140+ }
138141
139142 async function shutdown ( browser : Browser ) {
140143 const pages = await browser . pages ( ) ;
141144 for ( let i = 0 ; i < pages . length ; i ++ ) {
142145 await pages [ i ] . close ( ) ;
143146 }
144147 await browser . close ( ) ;
145- return ;
148+ return true ;
146149 }
147150}
You can’t perform that action at this time.
0 commit comments