Skip to content

Commit

Permalink
DOP-4599 logging
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed May 21, 2024
1 parent 8e2018d commit a9a5af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions api/controllers/v1/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export const DisplayRepoOptions = async (event: APIGatewayEvent): Promise<APIGat
async function deployRepo(deployable: Array<any>, logger: ILogger, jobRepository: JobRepository, jobQueueUrl) {
try {
await jobRepository.insertBulkJobs(deployable, jobQueueUrl);
return;
} catch (err) {
console.error('deploy repo error');
logger.error('deployRepo', err);
}
}
Expand Down Expand Up @@ -235,6 +237,7 @@ export const DeployRepo = async (event: any = {}): Promise<any> => {
const deployable = await getDeployableJobs(values, entitlement, repoBranchesRepository, docsetsRepository);

if (deployable.length > 0) {
console.log('deploying');
await deployRepo(deployable, consoleLogger, jobRepository, c.get('jobsQueueUrl'));
}
return {
Expand Down
4 changes: 3 additions & 1 deletion src/repositories/jobRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export class JobRepository extends BaseRepository {
// Insertion/re-enqueueing should be sent to jobs queue and updates for an existing job should be sent to jobUpdates Queue
this._logger.info(
'insertBulkJobs',
`Total Jobs Expected : ${jobs.length}, Jobs: ${JSON.stringify(jobIds)}, Total Jobs Sent: ${jobIds.length}`
`Total Jobs Expected : ${jobs.length}, Jobs: ${JSON.stringify(jobIds)}, Total Jobs Sent: ${
JSON.stringify(jobIds).length
}`
);
await Promise.all(
Object.values(jobIds).map(async (jobId: string) => {
Expand Down

0 comments on commit a9a5af6

Please sign in to comment.