I am seeing a strange issue in a commandbox module...
# box-products
r
I am seeing a strange issue in a commandbox module where if i am running the command in a
box
window. The first time I run the command it will output files properly. If I run the command again it will look like it completed successfully, but the updates will not be applied. Doing a
reload
and running the command works.
Running it through the cli solves the problem, but it just seemed strange.
b
Sorry, I'm not really following any of that
if i am running the command in a
box
window.
As opposed to...???
box
is simply the name of the binary that runs CommandBox. I'm not sure what you mean when you say "a box window". Can you provide a screenshot or more details to help explain?
it will output files properly
What files? I'm not sure what that means. Output somewhere on disk? Output text to the screen? Where is the code for this command?
the updates will not be applied.
What "updates"? I'm not sure what that means.
@Robert Zehnder
r
Instead of running from bash
box jasper build
if I am running in a commandbox window
b
Ok, so you mean running it from the interactive shell as opposed to a one-off command.
r
The process in question is rendering a file and writing it out to html
b
If something isn't getting reset or is getting corrupted, I assume running it as a one-off only works because it's a fresh CommandBox instance in memory every time (ComamndBox starts up, runs the command, and then shuts down as opposed to staying running in the interactive shell)
👍 1
r
It will say the process completed, but the html isn’t updated. Next step is to run down whether or not the fileRead is getting updated content.
b
So it sounds like some of your logic isn't running. You'd need to put in some debugging statements to see why
r
That was kinda inline with what I am thinking. Maybe variables bleeding over somewhere they shouldn’t
b
I think Command CFCs are singletons in memory so check for var scoping issues or assumptions about variables being defined in memory
r
I will run it down. It is probably an edge case
and my own fault lol
Turns out commandbox/lucee was caching the templates. Inside my build routine I had to issue a
systemCacheClear( "template" )
so it would recompile the templates
b
@Robert Zehnder Ah yes, I should have thought of that. The entire CLI session is seen as one "request" from Lucee's point of view so it's the same as having truste cache on basically. I also have to use
pagePoolClear()
when executing things like Task Runners as changes won't get picked up.
👍 1
r
To be fair, my description of the issue was terrible
b
No worries, just glad we got it sorted
👍 1