The latest update that GoHugo enjoyed resulted in all my website images being re-processed. This led to my website not compiling due to the following error:
Error: error building site: render: failed to render pages: render of "page" failed:
"/home/patrick/github.com/davidsneighbour/kollitsch.dev/layouts/_default/single.html:9:22":
execute of template failed:
template: _default/single.html:9:22:
executing "main" at <partials.Include>:
error calling Include: partial "content/post.html" timed out after 30s.
This is most likely due to infinite recursion. If this is just a slow
template, you can try to increase the 'timeout' config setting.
Which is something I know how to deal with. So this is not a support request.
But:
It feels weird that the error states something along the lines of “hey, either something is really very totally wrong or we just didn’t have time to do what we were trying to do”. Isn’t there a better way to deduct that the image processing process has issues doing “it’s thing” in the alotted time? I am asking out of curiosity, not pretending to know what minefields GoHugo is wading through to make my images look nice.
Does it have to be that processing images is in-separatably connected to something is in an infinite recursion in its detection?
My thought is that maybe there could be a way to tell GoHugo that timeouts should depend on whether a resource is available in the cache or not. If I delete the resources
folder of my website, the next build of the website will always result in an error if I do not add a longer timeout. If I add a longer timeout, the issue goes away, but also the time to “detect” recursions increases due to the timeout. So my “solution” is to increase the timeout configuration when I checkout the repository new and then decreasing it when I have a full resources
folder available. (IMHO resources
does not belong into my git repository. Maybe I should rethink that?)
Just asking, not complaining. If it’s one of those “there is no other way in Golang” things then just ignore me But somehow that error always triggers me and I think that less experienced users might be put off using GoHugo when a situation like this occurs.
Or, maybe, this is just my own problem and I have done something wrong in my theme?
Edit: It’s not a problem/bug with the latest release, my website in general times out when creating “from scratch” (on a new computer, after deleting resources
, etc.)