Skip to content

Commit

Permalink
Debug commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bhvishal9 committed Aug 20, 2024
1 parent 4f4d9c2 commit b725aa6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
PORT="8000"
AWS_ACCESS_KEY_ID="AWS_ACCESS_KEY_ID"
AWS_SECRET_ACCESS_KEY="AWS_SECRET_ACCESS_KEY"
S3_BUCKET="S3_BUCKET"
S3_TEST_BUCKET="S3_TEST_BUCKET"
S3_TEST_BUCKET="S3_TEST_BUCKET"
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ x-build: &build
x-env: &env
environment:
- PORT=${PORT}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- S3_BUCKET=${S3_BUCKET}
- S3_TEST_BUCKET=${S3_TEST_BUCKET}
- SENTRY_DSN=${SENTRY_DSN}
Expand All @@ -19,4 +17,4 @@ services:
<<: [*build, *env]
command: gunicorn -w 4 'vectorizing:create_app()' --timeout 0 -b 0.0.0.0:$PORT --log-level debug
ports:
- ${PORT}:${PORT}
- ${PORT}:${PORT}
1 change: 1 addition & 0 deletions vectorizing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def index():
timer = Timer()

timer.start_timer('Image Reading')
print(url)
img = try_read_image_from_url(url)
timer.end_timer()

Expand Down
6 changes: 3 additions & 3 deletions vectorizing/server/s3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cuid
import boto3

S3 = boto3.client("s3")
S3 = boto3.client("s3", region_name="eu-central-1", endpoint_url="https://s3.eu-central-1.amazonaws.com")

def upload_markup (markup, s3_bucket_name):
cuid_str = cuid.cuid()
Expand All @@ -21,7 +21,7 @@ def get_object_url(s3_file_key, s3_bucket_name):
Key=s3_file_key,
Bucket=s3_bucket_name
)

except(Exception):
return None

Expand All @@ -40,4 +40,4 @@ def upload_file(
s3_bucket_name,
s3_file_key,
)
return get_object_url(s3_file_key, s3_bucket_name)
return get_object_url(s3_file_key, s3_bucket_name)

0 comments on commit b725aa6

Please sign in to comment.