Index: openacs.org-dev/packages/acs-tcl/tcl/memoize-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/acs-tcl/tcl/memoize-procs.tcl,v diff -u -r1.1.1.1 -r1.1.1.2 --- openacs.org-dev/packages/acs-tcl/tcl/memoize-procs.tcl 9 Jul 2002 17:34:59 -0000 1.1.1.1 +++ openacs.org-dev/packages/acs-tcl/tcl/memoize-procs.tcl 8 Oct 2002 15:46:50 -0000 1.1.1.2 @@ -4,7 +4,7 @@ @author Various [acs@arsdigita.com] @author Rob Mayoff - @date 2000-10-19 + @creation-date 2000-10-19 @cvs-id $Id$ } @@ -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 + } + } +}