Detect placeholder when reading metadata

This commit is contained in:
yflory 2023-09-13 16:54:05 +02:00
parent 4d643e51a1
commit 235d5594f7
2 changed files with 13 additions and 1 deletions

View File

@ -392,7 +392,14 @@ var getDedicatedMetadata = function (env, channelId, handler, _cb) {
readMore();
}, function (err) {
// ENOENT => there is no metadata log
if (!err || err.code === 'ENOENT') { return void cb(); }
if (!err || err.code === 'ENOENT') {
if (err && err.code === 'ENOENT') {
return readPlaceholder(env, channelId, (content) => {
cb(content);
});
}
return void cb();
}
// otherwise stream errors?
cb(err);
});

View File

@ -193,6 +193,11 @@ define([
finish(Session, void 0, doc);
});
};
config.onChannelError = function (info) {
finish(Session, info);
};
overwrite(config, opt);
start(Session, config);