Index: openacs-4/packages/cms/tcl/publish-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/cms/tcl/publish-procs.tcl 9 May 2005 22:44:48 -0000 1.14 +++ openacs-4/packages/cms/tcl/publish-procs.tcl 16 May 2005 22:59:24 -0000 1.15 @@ -415,25 +415,22 @@ } { - if { [template::util::is_nil interval] } { - # Kludge: relies on that CMS is a singleton package - set package_id [apm_package_id_from_key "cms"] - if { ![template::util::is_nil package_id] } { - set interval [ad_parameter -package_id $package_id StatusSweepInterval 3600] - # if cms is installed but not mounted, return reasonable default - if { $interval == "" } { - set interval 3600 - } - } else { - ns_log Warning "publish::schedule_status_sweep: unable to lookup package_id for cms defaulting to interval 3600" - set interval 3600 - } - } + if { [template::util::is_nil interval] } { + + db_foreach package_id {} { - ns_log notice "publish::schedule_status_sweep: Scheduling status sweep every $interval seconds" - set proc_id [ns_schedule_proc -thread $interval publish::track_publish_status] - cache set status_sweep_proc_id $proc_id - + set interval [ad_parameter -package_id $package_id StatusSweepInterval 3600] + # if cms is installed but not mounted, return reasonable default + if { $interval == "" } { + set interval 3600 + ns_log Warning "publish::schedule_status_sweep: unable to lookup package_id for cms defaulting to interval 3600" + } + } + + ns_log notice "publish::schedule_status_sweep: Scheduling status sweep every $interval seconds" + set proc_id [ns_schedule_proc -thread $interval publish::track_publish_status] + cache set status_sweep_proc_id $proc_id + } } ad_proc -public publish::unschedule_status_sweep {} {