Skip to content

Commit

Permalink
add logs for debug purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot committed Jul 4, 2024
1 parent 3fe945d commit 14eae72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ query fetch_prequalified {
isPublished: is_published
isSearchable: is_searchable
description: meta_description
document
documentDescription: document(path: "$.description")
url: document(path: "$.url")
action: document(path: "$.action")
}
}
}
Expand All @@ -40,7 +42,9 @@ export interface FetchedPrequalified {
isPublished: boolean;
isSearchable: boolean;
description: string;
document: any;
documentDescription: string;
url?: string;
action?: string;
};
}[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import { GetBreadcrumbsFn } from "../breadcrumbs";
export const generatePrequalified = async (
getBreadcrumbs: GetBreadcrumbsFn
): Promise<PrequalifiedElasticDocument[]> => {
console.log("Fetch prequalified");
const prequalified = await fetchPrequalified();
if (!prequalified) {
return [];
}
console.log("Map prequalified");
return prequalified.map(({ variants, id, title, documents: refs }) => ({
cdtnId: id,
id,
Expand All @@ -32,10 +34,10 @@ export const generatePrequalified = async (
slug: document.slug,
title: document.title,
source: document.source,
description: document.description || document.document.description,
description: document.description || document.documentDescription,
breadcrumbs: getBreadcrumbs(document.cdtnId),
url: document.document.url, // pour les outils externes
action: document.document.action, // pour les outils (interne/externe)
url: document.url, // pour les outils externes
action: document.action, // pour les outils (interne/externe)
} as RelatedDocument)
),
}));
Expand Down
1 change: 1 addition & 0 deletions targets/export-elasticsearch/src/services/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class ExportService {
: "La mise à jour de la production a échouée. 😭",
process.env.MATTERMOST_CHANNEL_EXPORT
);
console.error("Failure", e);
return await this.exportRepository.updateOne(
id,
Status.failed,
Expand Down

0 comments on commit 14eae72

Please sign in to comment.