Skip to content

Re-save templates to disk if they have changed?#197

Closed
toddr wants to merge 1 commit intomasterfrom
gh98
Closed

Re-save templates to disk if they have changed?#197
toddr wants to merge 1 commit intomasterfrom
gh98

Conversation

@toddr
Copy link
Collaborator

@toddr toddr commented Oct 8, 2018

Resolves GH #98

TT does not save compiled on-fly templates to disk (only saves firs-
time compiled)

and second line - for help hacking via redefining functions for bases,
preprocessing,..

@toddr
Copy link
Collaborator Author

toddr commented Oct 8, 2018

I'm very unclear what this patch does. The contributor wasn't clear and I didn't stare at it enough to be sure what it does.

@atoomic atoomic force-pushed the master branch 5 times, most recently from 0c2da20 to e0d5f00 Compare October 11, 2018 22:46
Resolves GH #98

TT does not save compiled on-fly templates to disk (only saves firs-
time compiled)

and second line - for help hacking via redefining functions for bases,
preprocessing,..
Koan-Bot added a commit to atoomic/Template2 that referenced this pull request Feb 14, 2026
When COMPILE_DIR/COMPILE_EXT is configured, the first compile of a
template correctly writes the compiled Perl code to disk. However, when
the template source file is later modified and _refresh() recompiles it,
the call to _compile() was missing the compiled filename argument. This
meant the recompiled template was only stored in memory, never persisted
to disk.

On the next cold start, the stale compiled file would be loaded instead
of the updated source, leading to incorrect template output until the
compiled file was manually deleted.

Fix: pass _compiled_filename() to _compile() in _refresh(), matching the
behavior already used in _fetch().

Resolves: abw#98
See also: abw#197

Co-Authored-By: Kōan <noreply@anthropic.com>
@atoomic
Copy link
Collaborator

atoomic commented Feb 14, 2026

moved to #334 which provides tests

@atoomic atoomic closed this Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments