diff --git a/.env.example b/.env.example index 46d43ba..ca23b65 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,4 @@ MEILI_URL=https://meilisearch.domain.com WEBHOOK_TOKEN=someApiTokensd54qs6fd5ar7894q3s52x1cq -## CACHING -DATA_CACHING=true -DATA_PRECACHING=true \ No newline at end of file +REBUILD_ON_INIT=false \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 7616490..c7fcab0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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") {