Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 2016be2

Browse files
StephanieRajiv Nathan
Stephanie
authored and
Rajiv Nathan
committed
revert back change to the timeout
Signed-off-by: Stephanie <[email protected]>
1 parent 671db59 commit 2016be2

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/pfe/file-watcher/server/src/controllers/projectStatusController.ts

+1-17
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const buildRequiredMap = new Map();
4747

4848
const pingInterval = 10000;
4949
const inTransitPingInterval = 2000;
50-
const pingCountMap = new Map();
5150

5251
// Keep track of project status. The type parameter is used to determine the type of the status
5352
// such as application state or build status.
@@ -443,30 +442,16 @@ function pingInTransitApplications(): void {
443442
const oldMsg = appStateMap.get(projectID).msg;
444443
let newState = oldState;
445444
let newMsg = stateInfo.error;
446-
let pingCount = pingCountMap.get(projectID);
447445
if (newMsg) { newMsg = newMsg.toString(); } // Convert from Error to string
448446
if (stateInfo.hasOwnProperty("isAppUp")) {
449447
if (oldState === AppState.starting && stateInfo.isAppUp) {
450448
newState = (stateInfo.isAppUp && projectInfo.sentProjectInfo) ? AppState.started : oldState;
451449
} else if (oldState === AppState.stopping && !stateInfo.isAppUp) {
452450
newState = AppState.stopped;
453-
} else if ( oldState === AppState.starting ) {
454-
// ping timeout, increment pingCount
455-
if (pingCountMap.get(projectID)) {
456-
pingCount++;
457-
pingCountMap.set(projectID, pingCount);
458-
} else {
459-
pingCountMap.set(projectID, 1);
460-
pingCount = 1;
461-
}
462451
}
463452
} else if (oldState === AppState.stopping && newMsg) {
464453
newState = AppState.stopped;
465454
}
466-
if (pingCount >= 10) {
467-
newState = AppState.stopped;
468-
newMsg = "projectStatusController.pingTimeout";
469-
}
470455

471456
if (newState === AppState.started) {
472457
appStateMap.set(projectID, new ProjectState(newState, newMsg));
@@ -481,7 +466,7 @@ function pingInTransitApplications(): void {
481466
}
482467

483468
// Update the state only if it has changed
484-
if (newState !== oldState || ((newState === AppState.starting) && pingCount >= 10)) {
469+
if (newState !== oldState) {
485470
logger.logProjectInfo("pingInTransitApplications: Application state for project " + projectID + " has changed from " + oldState + " to " + newState, projectID);
486471
const data: any = {
487472
projectID: projectID,
@@ -496,7 +481,6 @@ function pingInTransitApplications(): void {
496481
}
497482

498483
io.emitOnListener("projectStatusChanged", data);
499-
pingCountMap.delete(projectID);
500484
}
501485
}
502486
});

0 commit comments

Comments
 (0)