update time

This commit is contained in:
熊潇 2025-06-22 19:41:51 +08:00
parent e982ddb001
commit a25f7c7eb4
2 changed files with 9 additions and 3 deletions

View File

@ -23,7 +23,7 @@ export const getTimeDuration = () => {
{ {
start: '12:01', start: '12:01',
end: '14:00', end: '14:00',
duration: 20 * 1000, // 20s duration: 30 * 1000, // 30s
}, },
{ {
start: '14:01', start: '14:01',
@ -32,9 +32,14 @@ export const getTimeDuration = () => {
}, },
{ {
start: '18:01', start: '18:01',
end: '23:59', end: '22:00',
duration: 10 * 1000, // 10s duration: 10 * 1000, // 10s
}, },
{
start: '22:01',
end: '23:59',
duration: 3 * 1000, // 3s
},
{ {
start: '00:01', start: '00:01',
end: '03:00', end: '03:00',

View File

@ -14,7 +14,7 @@ class TimeRecorder {
endTime: number; endTime: number;
duration: number; duration: number;
updateTime: number; updateTime: number;
maxDuration: number = 40 * 1000; // 30s; maxDuration: number = 30 * 1000; // 30s;
constructor() { constructor() {
const now = Date.now(); const now = Date.now();
this.startTime = now; this.startTime = now;
@ -105,6 +105,7 @@ worker.on('completed', async (job) => {
const nextTime = up.nextTime + getTimeDuration(); const nextTime = up.nextTime + getTimeDuration();
const unread = await queue.getJob('unread'); const unread = await queue.getJob('unread');
if (!unread) { if (!unread) {
console.log('====add unread next-time', nextTime, getTimeDuration());
addUnreadTask(nextTime); addUnreadTask(nextTime);
} }
} }