From 315b2d78f092bcf7afac14e33193cae1fa3d3a77 Mon Sep 17 00:00:00 2001 From: duogenesis <136373989+duogenesis@users.noreply.github.com> Date: Sun, 19 Jan 2025 05:35:39 +1100 Subject: [PATCH] Update boto3 config for cron service (#611) --- service/cron/checkphotos/__init__.py | 5 +++++ service/cron/util/__init__.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/service/cron/checkphotos/__init__.py b/service/cron/checkphotos/__init__.py index 1a2afbdc..d1ea9072 100644 --- a/service/cron/checkphotos/__init__.py +++ b/service/cron/checkphotos/__init__.py @@ -8,6 +8,7 @@ ) import asyncio import boto3 +from botocore.config import Config import os import random import io @@ -42,6 +43,10 @@ endpoint_url=BOTO_ENDPOINT_URL, aws_access_key_id=R2_ACCESS_KEY_ID, aws_secret_access_key=R2_ACCESS_KEY_SECRET, + config=Config( + request_checksum_calculation='WHEN_REQUIRED', + response_checksum_validation='WHEN_REQUIRED', + ), ) async def update_blurhashes(uuids: list[str]): diff --git a/service/cron/util/__init__.py b/service/cron/util/__init__.py index 60d8b950..327ca15c 100644 --- a/service/cron/util/__init__.py +++ b/service/cron/util/__init__.py @@ -4,6 +4,7 @@ from service.cron.util.sql import * import asyncio import boto3 +from botocore.config import Config import io import os import traceback @@ -53,6 +54,10 @@ async def delete_images_from_object_store( endpoint_url=BOTO_ENDPOINT_URL, aws_access_key_id=R2_ACCESS_KEY_ID, aws_secret_access_key=R2_ACCESS_KEY_SECRET, + config=Config( + request_checksum_calculation='WHEN_REQUIRED', + response_checksum_validation='WHEN_REQUIRED', + ), ) for chunk in chunks: