feat: migration von directus zu payloadcms
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 1m19s
Build & Deploy / 🧪 QA (push) Failing after 3m32s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Failing after 7m51s
Build & Deploy / ⚡ Lighthouse (push) Has been skipped
Build & Deploy / 🧪 Smoke Test (push) Has been skipped
Build & Deploy / ♿ WCAG (push) Has been skipped
Build & Deploy / 🛡️ Quality Gates (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 10s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 1m19s
Build & Deploy / 🧪 QA (push) Failing after 3m32s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Failing after 7m51s
Build & Deploy / ⚡ Lighthouse (push) Has been skipped
Build & Deploy / 🧪 Smoke Test (push) Has been skipped
Build & Deploy / ♿ WCAG (push) Has been skipped
Build & Deploy / 🛡️ Quality Gates (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 10s
This commit is contained in:
10
lib/mdx.ts
10
lib/mdx.ts
@@ -59,7 +59,7 @@ export async function getProductMetadata(
|
||||
.map((img) => (typeof img === 'string' ? img : img.url))
|
||||
.filter(Boolean);
|
||||
|
||||
if (resolvedImages.length === 0) return null; // Original logic skipped docs without images
|
||||
if (resolvedImages.length === 0) return null;
|
||||
|
||||
return {
|
||||
slug: doc.slug,
|
||||
@@ -152,7 +152,6 @@ export async function getAllProductSlugs(locale: string): Promise<string[]> {
|
||||
}
|
||||
|
||||
export async function getAllProducts(locale: string): Promise<ProductMdx[]> {
|
||||
// Fetch ALL products in a single query to avoid N+1 getPayload() calls
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
|
||||
const selectFields = {
|
||||
@@ -163,7 +162,7 @@ export async function getAllProducts(locale: string): Promise<ProductMdx[]> {
|
||||
categories: true,
|
||||
images: true,
|
||||
locale: true,
|
||||
};
|
||||
} as const;
|
||||
|
||||
// Get products for this locale
|
||||
const result = await payload.find({
|
||||
@@ -193,7 +192,7 @@ export async function getAllProducts(locale: string): Promise<ProductMdx[]> {
|
||||
.filter(Boolean),
|
||||
locale: doc.locale,
|
||||
},
|
||||
content: null, // Avoided loading into memory!
|
||||
content: null,
|
||||
}));
|
||||
|
||||
// Also include English fallbacks for slugs not in this locale
|
||||
@@ -230,7 +229,7 @@ export async function getAllProducts(locale: string): Promise<ProductMdx[]> {
|
||||
locale: doc.locale,
|
||||
isFallback: true,
|
||||
},
|
||||
content: null, // Avoided loading into memory!
|
||||
content: null,
|
||||
}));
|
||||
|
||||
products = [...products, ...fallbacks];
|
||||
@@ -240,7 +239,6 @@ export async function getAllProducts(locale: string): Promise<ProductMdx[]> {
|
||||
}
|
||||
|
||||
export async function getAllProductsMetadata(locale: string): Promise<Partial<ProductMdx>[]> {
|
||||
// Reuse getAllProducts to avoid separate N+1 queries
|
||||
const products = await getAllProducts(locale);
|
||||
return products.map((p) => ({
|
||||
slug: p.slug,
|
||||
|
||||
@@ -83,6 +83,19 @@ export class GlitchtipErrorReportingService implements ErrorReportingService {
|
||||
|
||||
async captureMessage(message: string, level: ErrorReportingLevel = 'error') {
|
||||
if (!this.options.enabled) return undefined;
|
||||
|
||||
// Send 404s and critical messages straight to Gotify
|
||||
if (
|
||||
this.notifications &&
|
||||
(level === 'error' || level === 'fatal' || message.includes('Route Not Found'))
|
||||
) {
|
||||
await this.notifications.notify({
|
||||
title: level === 'warning' ? '⚠️ Warning Captured' : '🔥 Critical Message Captured',
|
||||
message: message,
|
||||
priority: level === 'warning' ? 5 : 7,
|
||||
});
|
||||
}
|
||||
|
||||
const Sentry = await this.getSentry();
|
||||
return Sentry.captureMessage(message, level as any) as any;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ export class PinoLoggerService implements LoggerService {
|
||||
|
||||
child(bindings: Record<string, any>): LoggerService {
|
||||
const childPino = this.logger.child(bindings);
|
||||
const service = new PinoLoggerService();
|
||||
// @ts-expect-error - accessing private member for child creation
|
||||
// Bypass the constructor to avoid creating an orphaned, leaking pino instance
|
||||
const service = Object.create(PinoLoggerService.prototype);
|
||||
service.logger = childPino;
|
||||
return service;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user