Remove browsing selection ceilings
This commit is contained in:
1 parent
c028637556
commit
bc42c55555
14 files changed
+81
-53
No files matched your search
@@ -12,7 +12,6 @@ import type { Logger } from '../utils/logger.js';
|
||||
const MAX_CONTENT_AGE_MS = 7 * 24 * 60 * 60_000;
|
||||
const MIN_POST_CONTEXT = 12;
|
||||
const MIN_COMMENT_CONTEXT = 20;
|
||||
const MAX_DAILY_SELECTIONS = 12;
|
||||
|
||||
export interface BrowsingDecisionSink {
|
||||
recordSimulation(decision: BrowsingDecisionRecord): Promise<void>;
|
||||
@@ -95,11 +94,6 @@ export class AccountBrowsingSimulationService {
|
||||
const today = startOfLocalDay(now);
|
||||
const target = dailyTarget(this.options.accountId, today, settings);
|
||||
const selectedToday = this.options.repository.countSelectedSince(this.options.accountId, today);
|
||||
if (selectedToday >= MAX_DAILY_SELECTIONS) {
|
||||
const nextDueAt = moveOutsideQuietHours(today + 24 * 60 * 60_000, settings);
|
||||
this.options.repository.setNextDueAt(this.options.accountId, nextDueAt, now);
|
||||
return { kind: 'scheduled', nextDueAt };
|
||||
}
|
||||
if (!force && selectedToday >= target) {
|
||||
const nextDueAt = moveOutsideQuietHours(today + 24 * 60 * 60_000, settings);
|
||||
this.options.repository.setNextDueAt(this.options.accountId, nextDueAt, now);
|
||||
@@ -134,7 +128,7 @@ export class AccountBrowsingSimulationService {
|
||||
if (candidates.length === 0 && fallbackCandidates.length === 0) return { kind: 'scheduled', nextDueAt };
|
||||
|
||||
const sessionLimit = force
|
||||
? Math.min(settings.selectionsPerSession, MAX_DAILY_SELECTIONS - selectedToday)
|
||||
? settings.selectionsPerSession
|
||||
: Math.min(settings.selectionsPerSession, target - selectedToday);
|
||||
const selected = pickRandom(candidates, sessionLimit, this.random);
|
||||
if (selected.length < sessionLimit) {
|
||||
|
||||
Reference in new issue
Block a user