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 -N -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 10 Sep 2002 22:22:14 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 16 Sep 2002 22:30:46 -0000 1.4 @@ -135,3 +135,29 @@ return [expr {[ns_time] - $cache_time <= $max_age}] } } + + +ad_proc -public util_memoize_flush_regexp { + -log:boolean + expr +} { + + Loop through all cached scripts, flushing all that match the + regular expression that was passed in. + + @param expr The regular expression to match. + @param log Whether to log keys checked and flushed (useful for debugging). + +} { + foreach name [ns_cache names util_memoize] { + if $log_p { + ns_log Notice "flush_regexp: checking $name for $expr" + } + if [regexp $expr $name] { + if $log_p { + ns_log Notice "flush_regexp: flushing $name" + } + util_memoize_flush $name + } + } +}