Added REBUILD_ON_INIT env option
This commit is contained in:
parent
7feccde653
commit
7f388ac3e5
|
@ -9,6 +9,4 @@ MEILI_URL=https://meilisearch.domain.com
|
|||
|
||||
WEBHOOK_TOKEN=someApiTokensd54qs6fd5ar7894q3s52x1cq
|
||||
|
||||
## CACHING
|
||||
DATA_CACHING=true
|
||||
DATA_PRECACHING=true
|
||||
REBUILD_ON_INIT=false
|
|
@ -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") {
|
||||
|
|
Loading…
Reference in New Issue