File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ import {Semaphore} from "async-mutex";
11
11
12
12
13
13
type ParamTypeMap = Map < CxParamType , string > ;
14
+ const semaphore = new Semaphore ( 1 ) ; // Semaphore with 1 slot
15
+
14
16
15
17
export class CxWrapper {
16
18
private static instances = new Map < string , CxWrapper > ( ) ; // Multiton pattern
17
- private static semaphore = new Semaphore ( 1 ) ; // Semaphore with 1 slot
18
19
config : CxConfig ;
19
20
cxInstaller : CxInstaller ;
20
21
private constructor ( cxScanConfig : CxConfig , logFilePath ?: string ) {
@@ -50,7 +51,7 @@ export class CxWrapper {
50
51
}
51
52
52
53
static async getInstance ( cxScanConfig : CxConfig , logFilePath : string ) : Promise < CxWrapper > {
53
- const [ , release ] = await this . semaphore . acquire ( ) ;
54
+ const [ , release ] = await semaphore . acquire ( ) ;
54
55
const key = this . generateKey ( cxScanConfig , logFilePath ) ;
55
56
let wrapper = CxWrapper . instances . get ( key ) ;
56
57
if ( ! wrapper ) {
You can’t perform that action at this time.
0 commit comments