Skip to content

Commit d267293

Browse files
Copilotxadupre
andcommitted
gdot: prefix cache key with last segment of docname
Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
1 parent 9aa3ec3 commit d267293

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sphinx_runpython/gdot/sphinx_gdot_extension.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ def run(self):
155155
content = "\n".join(self.content)
156156
if script or script == "":
157157
env = info.get("env")
158-
cache_key = hashlib.sha256(f"{content}:{process}".encode()).hexdigest()
158+
doc_prefix = docname.split("/")[-1] if docname else ""
159+
cache_key = (
160+
f"{doc_prefix}:"
161+
+ hashlib.sha256(f"{content}:{process}".encode()).hexdigest()
162+
)
159163
if env is not None:
160164
if not hasattr(env, "gdot_script_cache"):
161165
env.gdot_script_cache = {}

0 commit comments

Comments
 (0)