Skip to content

Commit

Permalink
fix(store): generate links only for selected stores
Browse files Browse the repository at this point in the history
Resolves: #694
Signed-off-by: Jef LeCompte <[email protected]>
  • Loading branch information
jef committed Nov 22, 2020
1 parent 85bbaf9 commit 292e360
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/store/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export async function tryLookupAndLoop(browser: Browser, store: Store) {
return;
}

if (store.linksBuilder) {
if (getStores().has(store.name) && store.linksBuilder) {
const lastRunTime = linkBuilderLastRunTimes[store.name] ?? -1;
const ttl = store.linksBuilder.ttl ?? Number.MAX_SAFE_INTEGER;
if (lastRunTime === -1 || Date.now() - lastRunTime > ttl) {
Expand Down
2 changes: 1 addition & 1 deletion src/store/model/amazon-uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const AmazonUk: Store = {
url
});
} else {
logger.error(`Failed to parse card: ${title}`);
logger.error(`Failed to parse card: ${title}`, {url});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/model/helpers/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function getProductLinksBuilder(options: LinksBuilderOptions) {
url
});
} else {
logger.error(`Failed to parse card: ${title}`);
logger.error(`Failed to parse card: ${title}`, {url});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/model/very.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Very: Store = {
url
});
} else {
logger.error(`Failed to parse card: ${title}`);
logger.error(`Failed to parse card: ${title}`, {url});
}
}

Expand Down

0 comments on commit 292e360

Please sign in to comment.