Pace candidate funnel to send capacity
This commit is contained in:
1 parent
910576921b
commit
70c156e1f7
7 files changed
+113
-13
No files matched your search
@@ -77,10 +77,23 @@ describe('CandidateQueueRepository', () => {
|
||||
duplicateAuthor: 1,
|
||||
previouslyProcessed: 0,
|
||||
previouslyContacted: 0,
|
||||
deferredAtCapacity: 0,
|
||||
});
|
||||
expect(queue.getStats().byStatus.discovered).toBe(2);
|
||||
});
|
||||
|
||||
it('fills only the requested intake deficit and reports untouched posts', () => {
|
||||
const result = queue.enqueue([
|
||||
post('p1', 'alice'),
|
||||
post('p2', 'bob'),
|
||||
post('p3', 'carol'),
|
||||
], 'image', 1, 1_000, 2);
|
||||
|
||||
expect(result.discovered).toBe(2);
|
||||
expect(result.deferredAtCapacity).toBe(1);
|
||||
expect(queue.countActive()).toBe(2);
|
||||
});
|
||||
|
||||
it('excludes posts and recipients already handled anywhere', () => {
|
||||
db.prepare(`
|
||||
INSERT INTO processed_posts (account_id, id, subreddit, author, title, processed_at)
|
||||
|
||||
Reference in new issue
Block a user