Skip to content
Snippets Groups Projects
Commit 6f55e929 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-delete-container' into 'dev'

F delete container

See merge request !10
parents b14d7bfe 187418cb
No related branches found
No related tags found
1 merge request!10F delete container
Pipeline #7562 passed with warnings
...@@ -2806,6 +2806,17 @@ class Container(list): ...@@ -2806,6 +2806,17 @@ class Container(list):
this happens, none of them will be deleted. It occurs an error this happens, none of them will be deleted. It occurs an error
instead. instead.
""" """
chunk_size = 100
item_count = len(self)
# Split Container in 'chunk_size'-sized containers (if necessary) to avoid error 414 Request-URI Too Long
if item_count > chunk_size:
for i in range(0, int(item_count/chunk_size)+1):
chunk = Container()
for j in range(i*chunk_size, min(item_count, (i+1)*chunk_size)):
chunk.append(self[j])
if len(chunk):
chunk.delete()
return self
if len(self) == 0: if len(self) == 0:
if raise_exception_on_error: if raise_exception_on_error:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment