Починил время отправки сообщений, расширил список мотивирующих цитат
This commit is contained in:
1 parent
fdf78b92ef
commit
0269e62f16
2 files changed
+1072
-38
No files matched your search
+1070
-37
File diff suppressed because it is too large.
Load diff
@@ -34,7 +34,8 @@ export class SchedulerService {
|
|||||||
const diffMs = now.getTime() - lastSent.getTime();
|
const diffMs = now.getTime() - lastSent.getTime();
|
||||||
const diffHours = diffMs / (1000 * 60 * 60);
|
const diffHours = diffMs / (1000 * 60 * 60);
|
||||||
|
|
||||||
if (diffHours >= user.frequency) {
|
// Allow 3 minutes tolerance (0.05 hours) for cron execution delays
|
||||||
|
if (diffHours >= user.frequency - 0.05) {
|
||||||
await this.sendQuote(user);
|
await this.sendQuote(user);
|
||||||
// Updating user lastQuoteSentAt to now
|
// Updating user lastQuoteSentAt to now
|
||||||
// Update expects telegramId. user.telegramId is BigInt.
|
// Update expects telegramId. user.telegramId is BigInt.
|
||||||
|
|||||||
Reference in new issue
Block a user