Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Ftrack: Chunk sizes for queries has minimal condition #3244

Merged
merged 1 commit into from
May 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions openpype/modules/ftrack/lib/avalon_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,17 @@ def create_chunks(iterable, chunk_size=None):
list<list>: Chunked items.
"""
chunks = []
if not iterable:
return chunks

tupled_iterable = tuple(iterable)
if not tupled_iterable:
return chunks
iterable_size = len(tupled_iterable)
if chunk_size is None:
chunk_size = 200

if chunk_size < 1:
chunk_size = 1

for idx in range(0, iterable_size, chunk_size):
chunks.append(tupled_iterable[idx:idx + chunk_size])
return chunks
Expand Down