@@ -39,7 +39,7 @@ export class ProjectBuildCache {
39
39
* null === we haven't tried to initialize yet
40
40
* undefined === unable to initialize
41
41
*/
42
- private static _tarUtility : TarExecutable | null | undefined = null ;
42
+ private static _tarUtilityPromise : Promise < TarExecutable | undefined > | null = null ;
43
43
44
44
private readonly _project : RushConfigurationProject ;
45
45
private readonly _localBuildCacheProvider : FileSystemBuildCacheProvider ;
@@ -57,12 +57,12 @@ export class ProjectBuildCache {
57
57
this . _cacheId = cacheId ;
58
58
}
59
59
60
- private static _tryGetTarUtility ( terminal : ITerminal ) : TarExecutable | undefined {
61
- if ( ProjectBuildCache . _tarUtility === null ) {
62
- ProjectBuildCache . _tarUtility = TarExecutable . tryInitialize ( terminal ) ;
60
+ private static _tryGetTarUtility ( terminal : ITerminal ) : Promise < TarExecutable | undefined > {
61
+ if ( ProjectBuildCache . _tarUtilityPromise === null ) {
62
+ ProjectBuildCache . _tarUtilityPromise = TarExecutable . tryInitializeAsync ( terminal ) ;
63
63
}
64
64
65
- return ProjectBuildCache . _tarUtility ;
65
+ return ProjectBuildCache . _tarUtilityPromise ;
66
66
}
67
67
68
68
public static async tryGetProjectBuildCache (
@@ -180,7 +180,7 @@ export class ProjectBuildCache {
180
180
)
181
181
) ;
182
182
183
- const tarUtility : TarExecutable | undefined = ProjectBuildCache . _tryGetTarUtility ( terminal ) ;
183
+ const tarUtility : TarExecutable | undefined = await ProjectBuildCache . _tryGetTarUtility ( terminal ) ;
184
184
let restoreSuccess : boolean = false ;
185
185
if ( tarUtility && localCacheEntryPath ) {
186
186
const logFilePath : string = this . _getTarLogFilePath ( ) ;
@@ -263,7 +263,7 @@ export class ProjectBuildCache {
263
263
264
264
let localCacheEntryPath : string | undefined ;
265
265
266
- const tarUtility : TarExecutable | undefined = ProjectBuildCache . _tryGetTarUtility ( terminal ) ;
266
+ const tarUtility : TarExecutable | undefined = await ProjectBuildCache . _tryGetTarUtility ( terminal ) ;
267
267
if ( tarUtility ) {
268
268
const tempLocalCacheEntryPath : string = this . _localBuildCacheProvider . getCacheEntryPath ( cacheId ) ;
269
269
const logFilePath : string = this . _getTarLogFilePath ( ) ;
0 commit comments