Refill conversions: only count a genuine response. An unrelated ad already running is not a relaunch, and a still-running low campaign is not a conversion at all; adds a reset lever to re-decide verdicts

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-22 05:26:20 -05:00
parent 635844a12b
commit 67fb8193bd
2 changed files with 27 additions and 3 deletions
+5
View File
@@ -2912,6 +2912,11 @@ const server = http.createServer(async (req, res) => {
if (!isAdmin(req)) return json(res, 401, { error: 'auth' });
return json(res, 200, refill.stats());
}
if (p === '/api/admin/refill/reset' && req.method === 'POST') { // re-decide conversions under a corrected rule
if (!isAdmin(req)) return json(res, 401, { error: 'auth' });
const b = await readBody(req);
return json(res, 200, refill.resetConversions(Array.isArray(b.kinds) ? b.kinds : null));
}
if (p === '/api/admin/refill/run' && req.method === 'POST') { // send the next batch now instead of waiting for the tick
if (!isAdmin(req)) return json(res, 401, { error: 'auth' });
return json(res, 200, await refill.tick());