Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not log ESRCH errors when stopping liveview #115

Merged
merged 1 commit into from
Feb 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/fserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ FServer.stop = function (env) {
try {
let _pid = pidPath.replace(TMP_DIR, '').split('-')[0];
rm(pidPath);
log('[LiveView]'.green, 'Closing file/event server process id: ' + _pid);
log('[LiveView]'.green, 'Attempting to close file/event server process id: ' + _pid);
process.kill(_pid);
} catch (e) {
logError('[LiveView]'.red, 'Error closing server', e);
// Only log the error if it's not an ESRCH (no such process) as
// sometimes liveview does not clean up the pidfile when stopping
if (e.code !== 'ESRCH') {
logError('[LiveView]'.red, 'Error closing server', e);
}
}
});

Expand Down