Index: openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl,v diff -u -r1.18.2.4 -r1.18.2.5 --- openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 13 Jul 2022 09:54:32 -0000 1.18.2.4 +++ openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 29 Dec 2022 12:54:06 -0000 1.18.2.5 @@ -55,10 +55,11 @@ } -ad_proc -private util_memoize_flush_local {script} { - Forget any cached value for script. You probably want to use - util_memoize_flush to flush the caches on all servers - in the cluster, in case clustering is enabled. +ad_proc -private util_memoize_flush_local {script} { + Forget any cached value for script on the local server. + You probably want to use util_memoize_flush to flush + the caches on all servers in the cluster, in case clustering is + enabled. @param script The Tcl script whose cached value should be flushed. } { @@ -74,7 +75,7 @@ ::acs::clusterwide ns_cache flush util_memoize $script } -ad_proc -public util_memoize_flush_regexp { +ad_proc -private util_memoize_flush_regexp_local { -log:boolean expr } { @@ -104,6 +105,29 @@ } } +ad_proc -public util_memoize_flush_regexp { + -log:boolean + expr +} { + Loop through all cached entries, flushing all that match the + regular expression that was passed in. + + It is recommended to use util_memoize_flush_pattern whenever + possible, since glob-match is in most cases sufficient and much + better performance-wise. the glob match can be better supported by + the built-in set of the server. + + @see util_memoize_flush_pattern + + @param expr The regular expression to match. + @param log Whether to log keys checked and flushed (useful for debugging). +} { + ::acs::clusterwide util_memoize_flush_regexp_local \ + {*}[expr {$log_p ? "-log" : ""}] \ + $expr +} + + # Local variables: # mode: tcl # tcl-indent-level: 4