julianlam/nodebb-plugin-session-sharing

Could this be async.each?

Opened this issue · 2 comments

Following on from NodeBB/NodeBB#10410 could this upgrade use async.each instead of async.eachSeries. Is order important in this script? As far as I can tell it isn't but I'm not 100%.

async.eachSeries(values, function (value, next) {
progress.incr();
db.sortedSetAdd((settings.name || 'appId') + ':uid', hashData[value], value, next);
}, next);

Good lord this upgrade script is old.

If you still do need it, then it'd be best to have this one rewritten in async..await, but looking at that code, it should be fine to just change it to async.each.

Yeah I ended up rewriting it as async await in the end.