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