Skip to content

Commit

Permalink
fix: update content-type in batch job robotoff webhook call
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Sep 11, 2024
1 parent 374a829 commit 368ee12
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions batch/spellcheck/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def upload_gcs(file_path: str, bucket_name: str, suffix: str) -> None:
blob.upload_from_filename(filename=file_path)


def run_robotoff_endpoint_batch_import(batch_dir: str):
def run_robotoff_endpoint_batch_import(batch_dir: str) -> None:
"""Run Robotoff api endpoint to import batch data into tables."""
if "WEBHOOK_URL" not in os.environ or "BATCH_JOB_KEY" not in os.environ:
logger.error(
Expand All @@ -195,10 +195,7 @@ def run_robotoff_endpoint_batch_import(batch_dir: str):

url = os.environ["WEBHOOK_URL"]
data = {"job_type": "ingredients_spellcheck", "batch_dir": batch_dir}
headers = {
"Authorization": f"Bearer {os.environ['BATCH_JOB_KEY']}",
"Content-Type": "application/json",
}
headers = {"Authorization": f"Bearer {os.environ['BATCH_JOB_KEY']}"}
try:
response = requests.post(
url,
Expand Down

0 comments on commit 368ee12

Please sign in to comment.