Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: fullname search * fix: take last element * fix: attempt to fix psql like query * feat: upgrade sript, another fix attempt * fix: psql test * fix: psql scan * feat: add debug for test * feat: test collate * feat: cleanup * fix: upgrade script
- Loading branch information
1 parent
9389749
commit 4be693f
Showing
8 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
const db = require('../../database'); | ||
|
||
const batch = require('../../batch'); | ||
const user = require('../../user'); | ||
|
||
module.exports = { | ||
name: 'Create fullname search set', | ||
timestamp: Date.UTC(2020, 8, 11), | ||
method: async function () { | ||
const progress = this.progress; | ||
|
||
await batch.processSortedSet('users:joindate', async function (uids) { | ||
progress.incr(uids.length); | ||
const userData = await user.getUsersFields(uids, ['uid', 'fullname']); | ||
const bulkAdd = userData | ||
.filter(u => u.uid && u.fullname) | ||
.map(u => ['fullname:sorted', 0, u.fullname.toLowerCase() + ':' + u.uid]); | ||
await db.sortedSetAddBulk(bulkAdd); | ||
}, { | ||
batch: 500, | ||
progress: this.progress, | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters