Skip to content

Commit 2209b2c

Browse files
Merge pull request #6 from mcclatchy/cadence-update
change zone distribution cadence for out of market non-subscribers to 2
2 parents 570fe0f + da1653b commit 2209b2c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ function distributeZones(locker) {
2929
case "story":
3030
await config.load(locker.config.story);
3131

32-
// Change the cadence
32+
// Set cadence for subscriber vs. nonsubscriber vs. nonsubscriber out of market in test domains
3333
const subscriber = locker.user.isSubscriber();
34-
const cadence = subscriber ? 4 : 3;
34+
const dma = subscriber ? true : await locker.user.isInDMA();
35+
const nonsubscriberOutOfMarket = !subscriber && !dma;
36+
const domainName = locker.getConfig('domainName');
37+
const allowedDomains = ["www.bnd.com", "www.myrtlebeachonline.com"];
38+
const cadence = allowedDomains.includes(domainName) && nonsubscriberOutOfMarket ? 2 : (subscriber ? 4 : 3);
39+
3540
zones.distribute(cadence);
3641

3742
// Temporary cleanup

0 commit comments

Comments
 (0)