diff contrib/perf.py @ 51152:6a78b5a1d1ab stable

perf-tags: fix clear_cache_fnodes to actually clear that cache The function was not doing it what it advertise for a long time. So we fix it and we add a way for the perf extensions to detect broken version.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 03 Dec 2023 04:49:49 +0100
parents 2705748ba166
children 46fed351e451 8fc92193a2cf
line wrap: on
line diff
--- a/contrib/perf.py	Sun Dec 03 04:43:08 2023 +0100
+++ b/contrib/perf.py	Sun Dec 03 04:49:49 2023 +0100
@@ -973,11 +973,10 @@
         "clear_cache_on_disk",
         _default_clear_on_disk_tags_cache,
     )
-    clear_fnodes_fn = getattr(
-        tags,
-        "clear_cache_fnodes",
-        _default_clear_on_disk_tags_fnodes_cache,
-    )
+    if getattr(tags, 'clear_cache_fnodes_is_working', False):
+        clear_fnodes_fn = tags.clear_cache_fnodes
+    else:
+        clear_fnodes_fn = _default_clear_on_disk_tags_fnodes_cache
     clear_fnodes_rev_fn = getattr(
         tags,
         "forget_fnodes",