diff --git a/lib/storage/file.js b/lib/storage/file.js index 8cdfa747a..d890cb0b9 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -1222,17 +1222,18 @@ module.exports.create = function (conf, _cb) { // OFFSETS // these exist strictly as an optimization // you can always remove them without data loss - clearOffset: function (channelName, cb) { + clearOffset: function (channelName, _cb) { + var cb = Util.once(Util.mkAsync(_cb)); if (!isValidChannelId(channelName)) { return void cb(new Error('EINVAL')); } clearOffset(env, channelName, cb); }, writeOffset: function (channelName, data, _cb) { - var cb = Util.mkAsync(_cb); + var cb = Util.once(Util.mkAsync(_cb)); if (!isValidChannelId(channelName)) { return void cb(new Error('EINVAL')); } writeOffset(env, channelName, data, cb); }, getOffset: function (channelName, _cb) { - var cb = Util.mkAsync(_cb); + var cb = Util.once(Util.mkAsync(_cb)); if (!isValidChannelId(channelName)) { return void cb(new Error('EINVAL')); } getOffset(env, channelName, cb); },