mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
replaced Queue with deque in delete asset action
This commit is contained in:
parent
043fed0d00
commit
0094e956ff
1 changed files with 5 additions and 6 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import collections
|
import collections
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from queue import Queue
|
|
||||||
|
|
||||||
from bson.objectid import ObjectId
|
from bson.objectid import ObjectId
|
||||||
from openpype_modules.ftrack.lib import BaseAction, statics_icon
|
from openpype_modules.ftrack.lib import BaseAction, statics_icon
|
||||||
|
|
@ -473,12 +472,12 @@ class DeleteAssetSubset(BaseAction):
|
||||||
continue
|
continue
|
||||||
ftrack_ids_to_delete.append(ftrack_id)
|
ftrack_ids_to_delete.append(ftrack_id)
|
||||||
|
|
||||||
children_queue = Queue()
|
children_queue = collections.deque()
|
||||||
for mongo_id in assets_to_delete:
|
for mongo_id in assets_to_delete:
|
||||||
children_queue.put(mongo_id)
|
children_queue.append(mongo_id)
|
||||||
|
|
||||||
while not children_queue.empty():
|
while children_queue:
|
||||||
mongo_id = children_queue.get()
|
mongo_id = children_queue.popleft()
|
||||||
if mongo_id in asset_ids_to_archive:
|
if mongo_id in asset_ids_to_archive:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -494,7 +493,7 @@ class DeleteAssetSubset(BaseAction):
|
||||||
for child in children:
|
for child in children:
|
||||||
child_id = child["_id"]
|
child_id = child["_id"]
|
||||||
if child_id not in asset_ids_to_archive:
|
if child_id not in asset_ids_to_archive:
|
||||||
children_queue.put(child_id)
|
children_queue.append(child_id)
|
||||||
|
|
||||||
# Prepare names of assets in ftrack and ids of subsets in mongo
|
# Prepare names of assets in ftrack and ids of subsets in mongo
|
||||||
asset_names_to_delete = []
|
asset_names_to_delete = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue