ЛР 4: приватное S3-хранилище и вложения сообщений

This commit is contained in:
2026-11-12 16:06:09 +03:00
parent ec540a1a72
commit 03cd380fb8
26 changed files with 1028 additions and 74 deletions
+13
View File
@@ -0,0 +1,13 @@
import time
from app.main import s3, BUCKET
for attempt in range(60):
try:
client = s3()
if BUCKET not in [b['Name'] for b in client.list_buckets()['Buckets']]:
client.create_bucket(Bucket=BUCKET)
print('Private bucket ready')
break
except Exception:
if attempt == 59:
raise
time.sleep(1)