Skip to content

Node.js based forum software built for the modern web

wipe existing rss tokens

psychobunny6cb0d6f8c12d
diff --git a/src/upgrades/1.5.2/rss_token_wipe.js b/src/upgrades/1.5.2/rss_token_wipe.js
new file mode 100644
index 0000000000..c133bcd01c
--- /dev/null
+++ b/src/upgrades/1.5.2/rss_token_wipe.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var async = require('async');
+var batch = require('../../batch');
+var db = require('../../database');
+
+module.exports = {
+ name: 'Wipe all existing RSS tokens',
+ timestamp: Date.UTC(2017, 6, 5),
+ method: function (callback) {
+ var progress = this.progress;
+
+ batch.processSortedSet('users:joindate', function (uids, next) {
+ async.eachSeries(uids, function (uid, next) {
+ progress.incr();
+ db.deleteObjectField('user:' + uid, 'rss_token', next);
+ }, next);
+ }, {
+ progress: progress,
+ }, callback);
+ },
+};