View Single Post
Old 01-18-2025, 04:53 AM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Composite column values are cached in the db layer. If the underlying data is changed then db.cache.clear_caches() should be called to tell the composite evaluator to re-evaluate the column on next use. Looking at the annotations code in cache, this isn't happening.

I see 3 choices:
  • Do nothing. The caches will be cleared from time to time because of other operations.
  • cache.clear_caches() whenever the annotations change. This is a rather large hammer.
  • When annotations change, loop through the fields (columns) and clear the render cache for composites. This is a smaller hammer but requires more work to set up the loop.

A more targeted solution would be not to use a custom column for annotation count, instead calling the function directly. This avoids caching but requires that the processing be done on-demand. @Comfy.h: this might be possible depending on how your action chains work. Instead of referencing the a custom column to get the count, call the function directly.
chaley is offline   Reply With Quote