Подтвердить трек 2 реальными сбоями, нагрузкой и отчётом
This commit is contained in:
@@ -10,6 +10,17 @@ from src.storage import storage
|
||||
|
||||
def run(args):
|
||||
action = args['action']
|
||||
if action == 'anonymous':
|
||||
import boto3
|
||||
from botocore import UNSIGNED
|
||||
from botocore.config import Config
|
||||
from botocore.exceptions import ClientError
|
||||
s3 = boto3.client('s3', endpoint_url='http://s3:9000', config=Config(signature_version=UNSIGNED))
|
||||
try:
|
||||
s3.get_object(Bucket=BUCKET, Key=f"originals/{args['id']}")
|
||||
except ClientError as exc:
|
||||
return exc.response['ResponseMetadata']['HTTPStatusCode']
|
||||
return 200
|
||||
if action == 'sql':
|
||||
with storage.pool.connection() as conn:
|
||||
cursor = conn.execute(args['query'], args.get('params', []))
|
||||
|
||||
Reference in New Issue
Block a user