feat: add import-off make target for OpenFoodFacts import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: run run-worker-paid run-worker-free dev dev-infra-up dev-infra-down test test-integration lint migrate-up migrate-down migrate-create migrate-status docker-up docker-down docker-logs docker-logs-worker
|
||||
.PHONY: run run-worker-paid run-worker-free dev dev-infra-up dev-infra-down test test-integration lint migrate-up migrate-down migrate-create migrate-status docker-up docker-down docker-logs docker-logs-worker import-off
|
||||
|
||||
ifneq (,$(wildcard .env))
|
||||
include .env
|
||||
@@ -54,6 +54,17 @@ migrate-create:
|
||||
migrate-status:
|
||||
goose -dir migrations postgres "$(DATABASE_URL)" status
|
||||
|
||||
# OpenFoodFacts import
|
||||
# Usage: make import-off file=openfoodfacts-products.jsonl.gz
|
||||
# Optional: make import-off file=... limit=1000 batch=500 min-scans=1
|
||||
import-off:
|
||||
go run ./cmd/importoff \
|
||||
-file=$(file) \
|
||||
-dsn="$(DATABASE_URL)" \
|
||||
$(if $(limit),-limit=$(limit)) \
|
||||
$(if $(batch),-batch=$(batch)) \
|
||||
$(if $(min-scans),-min-scans=$(min-scans))
|
||||
|
||||
# Docker
|
||||
docker-up:
|
||||
docker compose up -d
|
||||
|
||||
Reference in New Issue
Block a user