Skip to content

Commit

Permalink
Merge pull request #92 from Cloudshelf/logging-trigger
Browse files Browse the repository at this point in the history
chore: add more logging
  • Loading branch information
ashleyww93 authored Dec 30, 2024
2 parents 8ef2142 + bd65b18 commit e1abd53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/modules/data-ingestion/product.job.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export class ProductJobUtils {
taskIdentifier: [RequestProductsTask.id],
tag: searchTags,
})) {
console.log(run);
pendingRuns.push({ id: run.id, type: run.tags.includes('type_full') ? 'type_full' : 'type_partial' });
const i: { id: string; type: 'type_full' | 'type_partial' } = {
id: run.id,
type: run.tags.includes('type_full') ? 'type_full' : 'type_partial',
};
pendingRuns.push(i);
console.log(`pushing pending run`, i);
}
logs?.info(`Found ${pendingRuns.length} existing jobs...`);

Expand Down
12 changes: 10 additions & 2 deletions src/modules/tools/tools.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,17 @@ export class ToolsResolver {
}

if (partial) {
await ProductJobUtils.scheduleTriggerJob(retailer, false, 10, 'forceViaGql');
await ProductJobUtils.scheduleTriggerJob(retailer, false, 10, 'forceViaGql', {
info: (s, o) => console.info(s, o),
warn: (s, o) => console.warn(s, o),
error: (s, o) => console.error(s, o),
});
} else {
await ProductJobUtils.scheduleTriggerJob(retailer, true, undefined, 'forceViaGql');
await ProductJobUtils.scheduleTriggerJob(retailer, true, undefined, 'forceViaGql', {
info: (s, o) => console.info(s, o),
warn: (s, o) => console.warn(s, o),
error: (s, o) => console.error(s, o),
});
}
return 'Scheduled a sync';
}
Expand Down

0 comments on commit e1abd53

Please sign in to comment.