Skip to content

Commit 0ccc238

Browse files
lmignonAntoni Marroig Campomar
authored andcommitted
[FIX] fs_attachment_s3: Fix GC bulk delete to S3
s3fs uses aiobotocore as s3 client, which is asynchronous, but Odoo does not support async calls, therefore the call to delete objects from S3 was not working. The fsspec library provides a way to run async calls in a synchronous way. The fsspec.asyn.sync function is now used to run the async call to delete objects from S3, in a synchronous way, in order to make it work in Odoo.
1 parent 51cfad6 commit 0ccc238

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

fs_attachment_s3/models/fs_file_gc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def _gc_s3_bulk_delete(self):
9898
Bucket=bucket_name,
9999
Delete={"Objects": objects_to_delete},
100100
)
101-
102101
# Mass delete from database
103102
self._cr.execute(
104103
"DELETE FROM fs_file_gc WHERE store_fname = ANY(%s)",

0 commit comments

Comments
 (0)