Banners must stop when they have delivered what was bought
Marty: "if it's just gonna keep running, why would anyone use impressions to place the ad at all?" He is right, and my previous answer — calling the over-delivery a bonus — papered over a real flaw. Banner placements on this network have no cap. Left alone, 2,500 impressions buys an ad that runs until expiry, which makes the allowance decorative and the whole level ladder (2,500 at Scintilla to 150,000 at Corona) worth nothing. Nobody would ever spend the larger allowance for an identical outcome. Two changes so the impressions are genuinely the thing being spent: sweepCompleted() deactivates any campaign that has served its purchased amount. Runs 90s after boot and every 15 minutes, batches its stat reads, and only touches campaigns that are live, un-stopped and provably at or past what was bought. Nothing is refunded — they delivered in full. It re-reads the ledger after the network calls, since deactivating takes real time and another member may have launched in that window. New campaigns get days:30 instead of days:365. The allowance is monthly, so a campaign outliving the month it was paid from is the same bug by another route. Belt and braces — whichever ends it first. Copy corrected too: "still serving as a bonus" became "served in full — closing out", and the footnote now states plainly that a campaign ends when it has served what was bought. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,16 @@ const suiteTools = require('./suite-tools');
|
||||
const suiteEmail = require('./suite-email');
|
||||
const suiteVideo = require('./suite-video'); suiteVideo.init({ dataDir: DATA_DIR, publicDir: PUBLIC_DIR });
|
||||
const suiteTraffic = require('./suite-traffic'); suiteTraffic.init({ dataDir: DATA_DIR });
|
||||
// Close out ad campaigns that have delivered what was bought. Banners on this
|
||||
// network have no cap of their own, so without this an ad runs until expiry
|
||||
// and the impression allowance stops meaning anything. Every 15 minutes, and
|
||||
// once shortly after boot.
|
||||
setTimeout(function(){ suiteTraffic.sweepCompleted().then(function(r){
|
||||
if(r&&r.closed)console.log('traffic sweep: closed '+r.closed+' completed campaign(s)');
|
||||
}).catch(function(){}); }, 90 * 1000);
|
||||
setInterval(function(){ suiteTraffic.sweepCompleted().then(function(r){
|
||||
if(r&&r.closed)console.log('traffic sweep: closed '+r.closed+' completed campaign(s)');
|
||||
}).catch(function(){}); }, 15 * 60 * 1000);
|
||||
const suiteTextAds = require('./suite-textads');
|
||||
const suiteVoice = require('./suite-voice'); suiteVoice.init({ dataDir: DATA_DIR });
|
||||
const suiteSplit = require('./suite-split'); suiteSplit.init({ dataDir: DATA_DIR });
|
||||
|
||||
Reference in New Issue
Block a user