That will stop Cheetah from using its cache, but it will still be added to sys.modules; so I think the memory will still grow over time. I think (2) is very reasonable. If a skin author is dynamically creating a template, they can just take the next step and create the final content. That is what I ended up doing. I thought I was being smart and was dynamically creating a template because it would allow code reuse. Once I realized what was happening, I changed the skin to create the final content. (Note, I had looked into ways to not update sys.modules, but in my mind the added complexity was not worth it.) rich On Monday, 26 June 2023 at 08:01:03 UTC-4 Tom Keffer wrote:
> That won't fix anything. Possible solutions: > > 1. Submit an issue to the Cheetah authors. > > 2. Adopt a best practice to not change template code. > > 3. Or, if you do, disable the Cheetah caching. Put this in the Belchertown > code somewhere: > > import Cheetah.Template.Templace > Cheetah.Template.Template._CHEETAH_useCompilationCache = False > > > -tk > > > On Sun, Jun 25, 2023 at 9:35 PM Karen K <[email protected]> wrote: > >> Tom Keffer schrieb am Sonntag, 25. Juni 2023 um 23:22:50 UTC+2: >> >> Nicely done, Rich. Fits the facts perfectly. >> >> >> >> So we could include some monitoring of sys.modules in the core loop of >> WeeWX and complain to the logs if there is such an issue? >> >> -- >> > You received this message because you are subscribed to the Google Groups >> "weewx-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/0813965d-814f-4297-ac1b-b4c40a364396n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/weewx-user/0813965d-814f-4297-ac1b-b4c40a364396n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/3ca1b711-2f10-45aa-bedd-24480749a841n%40googlegroups.com.
