Fix model cache gc.collect() condition.

This commit is contained in:
Ryan Dick 2023-11-04 08:52:10 -04:00
parent fb3d0c4b12
commit aa02ebf8f5

View File

@ -493,7 +493,7 @@ class ModelCache(object):
else:
pos += 1
if models_cleared < 0:
if models_cleared > 0:
# There would likely be some 'garbage' to be collected regardless of whether a model was cleared or not, but
# there is a significant time cost to calling `gc.collect()`, so we want to use it sparingly. (The time cost
# is high even if no garbage gets collected.)