Index: openacs-4/packages/notifications/tcl/sweep-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/sweep-init.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/notifications/tcl/sweep-init.tcl 10 Sep 2002 22:23:11 -0000 1.4 +++ openacs-4/packages/notifications/tcl/sweep-init.tcl 16 Jan 2003 13:53:10 -0000 1.5 @@ -8,10 +8,10 @@ } -# Hack for now to test immediate deliveries -# FIXME -ad_schedule_proc -thread t 60 notification::sweep::cleanup_notifications +# DRB: The cleanup sweep interval should be made a parameter someday ... +ad_schedule_proc -thread t 900 notification::sweep::cleanup_notifications + foreach interval [notification::get_all_intervals] { set n_seconds [lindex $interval 2] if {$n_seconds > 0} { @@ -20,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