upd dev branche
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-11-15 22:30:31 +10:00
parent f37c6aeecd
commit b858c9db9d

7
app.py
View File

@ -90,7 +90,7 @@ def allowed_file(filename):
def post_to_post(post_key): def post_to_post(post_key):
#### TODO resize pics https://stackoverflow.com/questions/53337318/how-can-i-resize-image-with-pil-on-upload-and-serve-them-with-flask-cloudy
#### TODO allow only imgs, videos, and gifs #### TODO allow only imgs, videos, and gifs
if 'file' in request.files: if 'file' in request.files:
@ -100,10 +100,12 @@ def post_to_post(post_key):
files = request.files.getlist("file") files = request.files.getlist("file")
for file in files: for file in files:
size = os.fstat(file.fileno()).st_size size = os.fstat(file.fileno()).st_size
#### работает ли??
if allowed_file(file.filename): if allowed_file(file.filename):
minioClient.put_object( minioClient.put_object(
bucket_name, file.filename, file, size bucket_name, file.filename, file, size
) )
else: else:
print(f'somebody tried to put this inside minio: {file.filename} size: {size}') print(f'somebody tried to put this inside minio: {file.filename} size: {size}')
@ -152,6 +154,9 @@ def post_to_post(post_key):
#### TODO websockets #### TODO websockets
#### TODO kafka #### TODO kafka
#### TODO shards #### TODO shards
#### TODO grpc
if __name__ == "__main__": if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0') app.run(debug=True, host='0.0.0.0')