Skip to content

Commit c2f8e85

Browse files
authored
Merge pull request #2296 from NativeScript/raikov/fix-slow-create
Removed code that is no longer necessary. It causes performance issues.
2 parents 3136820 + deeb317 commit c2f8e85

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/npm-installation-manager.ts

-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import * as path from "path";
22
import * as semver from "semver";
33
import * as constants from "./constants";
4-
import {sleep} from "../lib/common/helpers";
54

65
export class NpmInstallationManager implements INpmInstallationManager {
76
private static NPM_LOAD_FAILED = "Failed to retrieve data from npm. Please try again a little bit later.";
87

98
constructor(private $npm: INodePackageManager,
109
private $logger: ILogger,
11-
private $lockfile: ILockFile,
1210
private $errors: IErrors,
1311
private $options: IOptions,
1412
private $fs: IFileSystem,
@@ -44,13 +42,6 @@ export class NpmInstallationManager implements INpmInstallationManager {
4442
public install(packageName: string, projectDir: string, opts?: INpmInstallOptions): IFuture<any> {
4543
return (() => {
4644

47-
// TODO: plamen5kov: figure a way to remove this
48-
while(this.$lockfile.check().wait()) {
49-
sleep(10);
50-
}
51-
52-
this.$lockfile.lock().wait();
53-
5445
try {
5546
let packageToInstall = this.$options.frameworkPath || packageName;
5647
let pathToSave = projectDir;
@@ -61,8 +52,6 @@ export class NpmInstallationManager implements INpmInstallationManager {
6152
} catch(error) {
6253
this.$logger.debug(error);
6354
this.$errors.fail("%s. Error: %s", NpmInstallationManager.NPM_LOAD_FAILED, error);
64-
} finally {
65-
this.$lockfile.unlock().wait();
6655
}
6756

6857
}).future<string>()();

0 commit comments

Comments
 (0)