Added REBUILD_ON_INIT env option

This commit is contained in:
DrMint 2024-07-28 22:37:13 +02:00
parent 7feccde653
commit 7f388ac3e5
2 changed files with 4 additions and 4 deletions

View File

@ -9,6 +9,4 @@ MEILI_URL=https://meilisearch.domain.com
WEBHOOK_TOKEN=someApiTokensd54qs6fd5ar7894q3s52x1cq
## CACHING
DATA_CACHING=true
DATA_PRECACHING=true
REBUILD_ON_INIT=false

View File

@ -3,7 +3,9 @@ import { synchronizeMeiliDocs } from "./synchro";
import { webhookHandler } from "src/webhook";
import type { EndpointChange } from "src/shared/payload/webhooks";
await synchronizeMeiliDocs();
if (process.env.REBUILD_ON_INIT === "true") {
await synchronizeMeiliDocs();
}
export const requestListener: http.RequestListener = async (req, res) => {
if (req.method !== "POST") {