Handle unscheduled browsing simulation ticks
This commit is contained in:
1 parent
7bf1aa9d24
commit
643c775813
1 file changed
+3
-1
@@ -74,7 +74,9 @@ export class AccountBrowsingSimulationService {
|
||||
this.options.repository.setNextDueAt(this.options.accountId, nextDueAt, now);
|
||||
return { kind: 'scheduled', nextDueAt };
|
||||
}
|
||||
if (!force && now < settings.nextDueAt) return { kind: 'idle', reason: 'Browsing simulation is not due' };
|
||||
if (!force && settings.nextDueAt !== null && now < settings.nextDueAt) {
|
||||
return { kind: 'idle', reason: 'Browsing simulation is not due' };
|
||||
}
|
||||
if (!force && isQuietTime(new Date(now), settings)) {
|
||||
const nextDueAt = moveOutsideQuietHours(now, settings);
|
||||
this.options.repository.setNextDueAt(this.options.accountId, nextDueAt, now);
|
||||
|
||||
Reference in new issue
Block a user