jenkins-bot has submitted this change and it was merged.
Change subject: Don't stop gc'ing if a file disappears.
......................................................................
Don't stop gc'ing if a file disappears.
When running two gc jobs simultaneously (for example, if one is manually
started and then the automatically-scheduled one in the service begins)
some files can 'disappear' before we have a chance to delete them.
Don't crash the gc thread if that happens, continue gc'ing the rest
of the files.
Change-Id: I426029244ccf5a173b2d822560d238221c1d8aa6
---
M lib/threads/gc.js
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
Arlolra: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/threads/gc.js b/lib/threads/gc.js
index fe86c54..938633d 100644
--- a/lib/threads/gc.js
+++ b/lib/threads/gc.js
@@ -181,7 +181,10 @@
var count = 0, errors = [];
if (!dir || !lifetime) { return; }
var clean = function( dir, force ) {
- return readdir( dir ).map( function( file ) {
+ return readdir( dir ).catch( function( error ) {
+ // directory already removed?
+ errors.push( dir );
+ }).map( function( file ) {
var fullpath = path.join( dir, file );
return lstat( fullpath ).then(function( stat ) {
// skip files/directories based on
modification time
@@ -213,6 +216,9 @@
errors.push( fullpath );
});
}
+ }, function(error) {
+ // error during stat -- file already
gone?
+ errors.push( fullpath );
});
});
};
--
To view, visit https://gerrit.wikimedia.org/r/165005
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I426029244ccf5a173b2d822560d238221c1d8aa6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits