Index: openacs-4/packages/acs-tcl/tcl/20-memoize-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/20-memoize-init.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/20-memoize-init.tcl 7 Aug 2017 23:47:59 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/20-memoize-init.tcl 3 Sep 2024 15:37:34 -0000 1.8 @@ -1,42 +1,12 @@ +# +# Note: this file is not only called as regular init procs, but as +# well out-of-band during bootstrapping a new installation. +# # Create the cache used by util_memoize. - -# Note: we must pass the package_id to parameter::get, because -# otherwise parameter::get will end up calling util_memoize to figure -# out the package_id. - +# ns_cache create util_memoize -size \ - [parameter::get -package_id [ad_acs_kernel_id] -parameter MaxSize -default 200000] + [parameter::get -package_id $::acs::kernel_id -parameter MaxSize -default 200000] - -# We construct the body of util_memoize_flush differently depending -# on whether clustering is enabled and what command is available for -# cluster-wide flushing. - -if {[info commands ncf.send] ne ""} { - set flush_body { - ncf.send util_memoize $script - } -} elseif {[server_cluster_enabled_p] && [info commands server_cluster_httpget_from_peers] ne ""} { - set flush_body { - server_cluster_httpget_from_peers "/SYSTEM/flush-memoized-statement.tcl?statement=[ns_urlencode $script]" - } -} else { - set flush_body {} -} - -append flush_body { - ns_cache flush util_memoize $script -} - -ad_proc -public util_memoize_flush {script} { - Forget any cached value for script. If clustering is - enabled, flush the caches on all servers in the cluster. - - @param script The Tcl script whose cached value should be flushed. -} $flush_body - -unset flush_body - # Local variables: # mode: tcl # tcl-indent-level: 4