@@ -6,19 +6,12 @@ import getObjectJson from '../../lib/s3-utils.js'
66import logger from '../../lib/logger.js'
77import { AssetProxy } from '../../lib/asset-proxy.js'
88
9- let assetProxyInstance = null
9+ let assetProxy = new AssetProxy ( )
10+ await assetProxy . initialize ( )
1011
11- const getAssetProxy = async ( ) => {
12- if ( ! assetProxyInstance ) {
13- assetProxyInstance = new AssetProxy ( )
14- await assetProxyInstance . initialize ( )
15- }
16-
17- return assetProxyInstance
18- }
19-
20- export const resetAssetProxy = ( ) => {
21- assetProxyInstance = null
12+ export const resetAssetProxy = async ( ) => {
13+ assetProxy = new AssetProxy ( )
14+ await assetProxy . initialize ( )
2215}
2316
2417const isSqsEvent = ( event ) => 'Records' in event
@@ -92,7 +85,7 @@ export const handler = async (event, _context) => {
9285
9386 if ( postIngestTopicArn ) {
9487 logger . debug ( 'Publishing to post-ingest topic: %s' , postIngestTopicArn )
95- const assetProxy = await getAssetProxy ( )
88+ // const assetProxy = await getAssetProxy()
9689 await publishResultsToSns ( results , postIngestTopicArn , assetProxy )
9790 } else {
9891 logger . debug ( 'Skipping post-ingest notification since no topic is configured' )
0 commit comments