====
- fix the log.* entries that need to be errors
-- metadata check on maintenance routines
\ No newline at end of file
+- metadata check on maintenance routines
+- fix the upstream request pipeline, many dead ends here
+
+
+events.js:71
+ throw arguments[1]; // Unhandled 'error' event
+ ^
+Error: getaddrinfo ENOTFOUND
+ at errnoException (dns.js:37:11)
+ at Object.onanswer [as oncomplete] (dns.js:124:16)
// we look for repodata/repomd.xml file, if this is past maturity, we clean that whole directory
if(!inDownload) {
+
+ var metafile = files[i].replace(/(.*)\/(.[^\/]+$)/, "$1/.meta.$2.filesize");
+
if(files[i].match(/.*repodata\/repomd\.xml$/)) {
log.debug("Found repomd.xml file: ", files[i]);
// TODO: cleanup singular file
// TODO: cleanup meta too, fuck me
//log.debug("clean up file \n", files[i]);
- var metafile = files[i].replace(/(.*)\/(.[^\/]+$)/, "$1/.meta.$2.filesize");
//log.debug("meta for this file is \n", nfile);
cache.moveToCleanup(files[i]);
cache.moveToCleanup(metafile);
}
})
}
+
+ // check meta data
+ fs.stat(files[i], function(err, stats) {
+ var fsize = stats.size;
+ var mfile = fs.createReadStream(metafile);
+ var expSize = "";
+ mfile.on("data", function(data) {
+ expSize += data;
+ });
+
+ mfile.on("end", function(closed) {
+ if(fsize != parseInt(expSize)) {
+ log.debug("possible metadata clash for (%s) - (%d),(%s), removing file", files[i], fsize, expSize);
+ cache.moveToCleanup(files[i]);
+ cache.moveToCleanup(metafile);
+ } else {
+ log.debug("metadata good for (%s) - (%d),(%s)", files[i], fsize, expSize);
+ }
+ });
+
+ })
} else {
log.debug("file %s was ignored as its in download", files[i]);
}