|
|
|
@ -44,6 +44,18 @@ var getChannelMetadata = function (Env, channelId, cb) {
|
|
|
|
|
getMetadataAtPath(Env, path, cb);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var closeChannel = function (env, channelName, cb) {
|
|
|
|
|
if (!env.channels[channelName]) { return; }
|
|
|
|
|
try {
|
|
|
|
|
env.channels[channelName].writeStream.close();
|
|
|
|
|
delete env.channels[channelName];
|
|
|
|
|
env.openFiles--;
|
|
|
|
|
cb();
|
|
|
|
|
} catch (err) {
|
|
|
|
|
cb(err);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var clearChannel = function (Env, channelId, cb) {
|
|
|
|
|
var path = mkPath(Env, channelId);
|
|
|
|
|
getMetadataAtPath(Env, path, function (e, metadata) {
|
|
|
|
@ -112,18 +124,6 @@ var removeChannel = function (env, channelName, cb) {
|
|
|
|
|
Fs.unlink(filename, cb);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var closeChannel = function (env, channelName, cb) {
|
|
|
|
|
if (!env.channels[channelName]) { return; }
|
|
|
|
|
try {
|
|
|
|
|
env.channels[channelName].writeStream.close();
|
|
|
|
|
delete env.channels[channelName];
|
|
|
|
|
env.openFiles--;
|
|
|
|
|
cb();
|
|
|
|
|
} catch (err) {
|
|
|
|
|
cb(err);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var flushUnusedChannels = function (env, cb, frame) {
|
|
|
|
|
var currentTime = +new Date();
|
|
|
|
|
|
|
|
|
|