Skip to content

Commit

Permalink
Update boto3 config for cron service (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
duogenesis authored Jan 18, 2025
1 parent d6e8a24 commit 315b2d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service/cron/checkphotos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
import asyncio
import boto3
from botocore.config import Config
import os
import random
import io
Expand Down Expand Up @@ -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]):
Expand Down
5 changes: 5 additions & 0 deletions service/cron/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 315b2d7

Please sign in to comment.