Index: openacs.org-dev/packages/notifications/tcl/sweep-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/notifications/tcl/sweep-init.tcl,v diff -u -N -r1.5 -r1.6 --- openacs.org-dev/packages/notifications/tcl/sweep-init.tcl 12 Dec 2002 12:44:16 -0000 1.5 +++ openacs.org-dev/packages/notifications/tcl/sweep-init.tcl 12 Feb 2003 13:18:07 -0000 1.6 @@ -8,14 +8,9 @@ } -# Hack for now to test immediate deliveries -# FIXME -# DaveB increase from one minute to 2 days. -# on advice from Cmeeks -# otherwise it cleans out unsent notifications before the daily -# scheduled proc runs +# DRB: The cleanup sweep interval should be made a parameter someday ... -ad_schedule_proc -thread t 172800 notification::sweep::cleanup_notifications +ad_schedule_proc -thread t 900 notification::sweep::cleanup_notifications foreach interval [notification::get_all_intervals] { set n_seconds [lindex $interval 2] @@ -25,7 +20,15 @@ set batched_p 0 } - if {$n_seconds > 0} { + # Send weekly and daily notifications at defined times rather than a week after + # the server was started up, etc etc. Hourly, instant, and exotic custom + # intervals will run relative to the server startup time. + + if { $n_seconds == 24 * 60 * 60 } { + ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 0] notification::sweep::sweep_notifications -interval_id [lindex $interval 1] -batched_p $batched_p + } elseif { $n_seconds == 7 * 24 * 60 * 60 } { + ad_schedule_proc -thread t -schedule_proc ns_schedule_weekly [list 0 0 0] notification::sweep::sweep_notifications -interval_id [lindex $interval 1] -batched_p $batched_p + } elseif {$n_seconds > 0} { ad_schedule_proc -thread t $n_seconds notification::sweep::sweep_notifications -interval_id [lindex $interval 1] -batched_p $batched_p } else { ad_schedule_proc -thread t 60 notification::sweep::sweep_notifications -interval_id [lindex $interval 1] -batched_p $batched_p