Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/151403
Change subject: Don't use `process.exit` on a normal successful exit.
......................................................................
Don't use `process.exit` on a normal successful exit.
The `process.exit` function completes abruptly and immediately, but
sometimes there is outstanding "stuff" which node still needs to do
(actually closing files, etc). In theory this shouldn't matter, but
in practice it seems to: we occasionally end up with truncated files.
Change-Id: Id289c91cbc98ea9d0767498dbbc86b9df12b8523
---
M bin/mw-ocg-bundler
1 file changed, 9 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/bundler
refs/changes/03/151403/1
diff --git a/bin/mw-ocg-bundler b/bin/mw-ocg-bundler
index b1eaf37..8bf1aa6 100755
--- a/bin/mw-ocg-bundler
+++ b/bin/mw-ocg-bundler
@@ -134,7 +134,15 @@
});
}).then(function(status) {
Syslog.close();
- process.exit(status);
+ if (status !== 0) {
+ // process.exit completes abruptly; sometimes there is
+ // outstanding "stuff" which node still needs to do
+ // (actually closing files, etc). In theory this shouldn't
+ // matter, but in practice it does. :( So don't call
+ // process.exit unless something seemed to have already
+ // gone wrong.
+ process.exit(status);
+ }
});
p.done(null, function(err) {
--
To view, visit https://gerrit.wikimedia.org/r/151403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id289c91cbc98ea9d0767498dbbc86b9df12b8523
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits