data.forEach(key => { this.client.del(key, (err, data) => { if (err) { count = 0; return fn(err); } if (--count == 0) { fn(null, null); } }); });