[cards] make them a smaller burden
This commit is contained in:
parent
acc452540c
commit
463d707948
|
@ -21,18 +21,19 @@ const modes = ['light', 'dark'];
|
|||
(async () => {
|
||||
const db = await dbConnection();
|
||||
while (true) {
|
||||
await sleep(5000);
|
||||
|
||||
const profiles = (await db.all(`
|
||||
SELECT profiles.id, profiles.locale, users.username
|
||||
FROM profiles
|
||||
LEFT JOIN users on profiles.userId = users.id
|
||||
WHERE profiles.card IS NULL
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 8
|
||||
LIMIT 6
|
||||
`)).filter(({locale}) => !isHighLoadTime(locale));
|
||||
|
||||
if (profiles.length === 0) {
|
||||
console.log('No profiles in the queue');
|
||||
await sleep(5000);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const overloadPeriods = {
|
||||
en: [[16, 23]],
|
||||
en: [[15, 24]],
|
||||
};
|
||||
|
||||
module.exports = (locale, timestamp = new Date) => {
|
||||
|
|
Reference in New Issue