File tree 4 files changed +18
-1
lines changed
4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as path from "path";
2
2
import * as semver from "semver" ;
3
3
import * as npm from "npm" ;
4
4
import * as constants from "./constants" ;
5
+ import { sleep } from "../lib/common/helpers" ;
5
6
6
7
export class NpmInstallationManager implements INpmInstallationManager {
7
8
private static NPM_LOAD_FAILED = "Failed to retrieve data from npm. Please try again a little bit later." ;
@@ -106,6 +107,11 @@ export class NpmInstallationManager implements INpmInstallationManager {
106
107
107
108
public install ( packageName : string , opts ?: INpmInstallOptions ) : IFuture < string > {
108
109
return ( ( ) => {
110
+
111
+ while ( this . $lockfile . check ( ) . wait ( ) ) {
112
+ sleep ( 10 ) ;
113
+ }
114
+
109
115
this . $lockfile . lock ( ) . wait ( ) ;
110
116
111
117
try {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import * as path from "path";
7
7
import * as net from "net" ;
8
8
9
9
class AndroidLiveSyncService extends liveSyncServiceBaseLib . LiveSyncServiceBase < Mobile . IAndroidDevice > implements IPlatformLiveSyncService {
10
- private static BACKEND_PORT = 18181 ;
10
+ private static BACKEND_PORT = 18182 ;
11
11
12
12
constructor ( _device : Mobile . IDevice ,
13
13
private $fs : IFileSystem ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as shelljs from "shelljs";
5
5
import Future = require( "fibers/future" ) ;
6
6
import * as destCopyLib from "./node-modules-dest-copy" ;
7
7
import * as fiberBootstrap from "../../common/fiber-bootstrap" ;
8
+ import { sleep } from "../../../lib/common/helpers" ;
8
9
9
10
let glob = require ( "glob" ) ;
10
11
@@ -34,6 +35,11 @@ export class Builder implements IBroccoliBuilder {
34
35
stat : true
35
36
} , ( er : Error , files : string [ ] ) => {
36
37
fiberBootstrap . run ( ( ) => {
38
+
39
+ while ( this . $lockfile . check ( ) . wait ( ) ) {
40
+ sleep ( 10 ) ;
41
+ }
42
+
37
43
this . $lockfile . lock ( ) . wait ( ) ;
38
44
if ( er ) {
39
45
if ( ! future . isResolved ( ) ) {
Original file line number Diff line number Diff line change @@ -410,6 +410,11 @@ export class HooksServiceStub implements IHooksService {
410
410
}
411
411
412
412
export class LockFile {
413
+
414
+ check ( ) : IFuture < boolean > {
415
+ return ( ( ) => { return false ; } ) . future < boolean > ( ) ( ) ;
416
+ }
417
+
413
418
lock ( ) : IFuture < void > {
414
419
return ( ( ) => { } ) . future < void > ( ) ( ) ;
415
420
}
You can’t perform that action at this time.
0 commit comments