Skip to content

Commit

Permalink
files: set bucket quota
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Sep 14, 2023
1 parent 192f9b1 commit 0146f20
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ def set_bucket(self, bucket, overwrite=False):
setattr(self.record, self._options["bucket_id_attr"], bucket.id)
self._bucket = bucket

def set_quota(self, quota_size, max_file_size=None):
"""Set bucket quota."""
if self.bucket is not None:
assert not self.bucket.locked
self.bucket.quota_size = quota_size
if max_file_size:
self.bucket.max_file_size = max_file_size

def lock(self):
"""Lock the bucket."""
self.bucket.locked = True
Expand Down

0 comments on commit 0146f20

Please sign in to comment.