[
https://issues.apache.org/jira/browse/CB-12905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16291357#comment-16291357
]
ASF GitHub Bot commented on CB-12905:
-------------------------------------
stevengill closed pull request #2: CB-12905: (linux) Fix issue with freezing
after launching the browser
URL: https://github.com/apache/cordova-serve/pull/2
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/src/exec.js b/src/exec.js
index d1c02a4..bc7e6ee 100644
--- a/src/exec.js
+++ b/src/exec.js
@@ -29,7 +29,14 @@ var child_process = require('child_process'),
module.exports = function (cmd, opt_cwd) {
var d = Q.defer();
try {
+ // In Linux, the callback is not called until the process terminates.
+ // If the error is not caused within 2 seconds, then the promise will
be resolved.
+ var timer = process.platform === 'linux' ?
+ setTimeout(function () {
+ d.resolve('TimeOut');
+ }, 2000) : undefined;
child_process.exec(cmd, {cwd: opt_cwd, maxBuffer: 1024000}, function
(err, stdout, stderr) {
+ clearTimeout(timer);
if (err) {
d.reject(new Error('Error executing "' + cmd + '": ' +
stderr));
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> LaunchBrowser promise in linux, not resolved until the browser process
> terminates.
> ----------------------------------------------------------------------------------
>
> Key: CB-12905
> URL: https://issues.apache.org/jira/browse/CB-12905
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-serve
> Affects Versions: 6.5.0, 7.0.1
> Environment: OS: Ubuntu 16.04.2 LTS
> cordova: 6.5.0
> simulate: 0.3.12
> node: v7.10.0
> npm: 4.6.1
> Reporter: Pavel Yakovlev
> Assignee: Steve Gill
> Priority: Minor
>
> LaunchBrowser promise in linux, not resolved until the browser process
> terminates.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]