clean: remove unused var

This commit is contained in:
Swann
2021-01-20 16:02:15 +01:00
parent 7a716b4c37
commit 9cc1c92e0e

View File

@ -712,10 +712,8 @@ class SessionPurgeOperator(bpy.types.Operator):
return True return True
def execute(self, context): def execute(self, context):
cache_dir = utils.get_preferences().cache_directory
try: try:
sanitize_deps_graph(None) sanitize_deps_graph(None)
except Exception as e: except Exception as e:
self.report({'ERROR'}, repr(e)) self.report({'ERROR'}, repr(e))
@ -959,17 +957,18 @@ def sanitize_deps_graph(dummy):
""" """
if session and session.state['STATE'] == STATE_ACTIVE: if session and session.state['STATE'] == STATE_ACTIVE:
start = utils.current_milli_time() start = utils.current_milli_time()
items_to_remove = [] rm_cpt = 0
for node_key in session.list(): for node_key in session.list():
node = session.get(node_key) node = session.get(node_key)
if not node.resolve(construct=False): if not node.resolve(construct=False):
try: try:
session.remove(node.uuid) session.remove(node.uuid)
rm_cpt+=1
except NonAuthorizedOperationError: except NonAuthorizedOperationError:
continue continue
logging.debug(f"Sanitize took { utils.current_milli_time()-start}ms") logging.debug(f"Sanitize took { utils.current_milli_time()-start}ms")
logging.info(f"Removed {rm_cpt} nodes")
@persistent @persistent
@ -1014,7 +1013,6 @@ def depsgraph_evaluation(scene):
try: try:
if node.has_changed(): if node.has_changed():
logging.info(len(session.list()))
session.commit(node.uuid) session.commit(node.uuid)
session.push(node.uuid, check_data=False) session.push(node.uuid, check_data=False)
except ReferenceError: except ReferenceError: