Index: openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-init.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-init.tcl 18 Aug 2005 14:30:28 -0000 1.3 +++ openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-init.tcl 25 Aug 2005 19:07:48 -0000 1.4 @@ -13,4 +13,4 @@ ad_schedule_proc -thread t 300 dotlrn_ecommerce::section::check_elapsed_registrations ad_schedule_proc -thread t 600 dotlrn_ecommerce::section::check_and_approve_sections_for_slots ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 23 50] dotlrn_ecommerce::notify_admins_of_waitlist -ad_schedule_proc -thread t -once t 660 dotlrn_ecommerce::section::check_expired_orders_once \ No newline at end of file +ad_schedule_proc -thread t -once t 660 dotlrn_ecommerce::check_expired_orders_once \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-procs.tcl 22 Aug 2005 23:15:00 -0000 1.4 +++ openacs-4/packages/dotlrn-ecommerce/tcl/dotlrn-ecommerce-procs.tcl 25 Aug 2005 19:07:48 -0000 1.5 @@ -106,3 +106,50 @@ } } } + +ad_proc -public dotlrn_ecommerce::check_expired_orders { +} { + Check recently expired orders in shopping cart and flush the cache + + @author Roel Canicula (roelmc@pldtdsl.net) + @creation-date 2005-08-18 + + @return + + @error +} { + # Loop thru recently expired orders + db_foreach expired_orders { + select order_id + from ec_orders + where order_state = 'expired' + and expired_date > (current_timestamp - '10 minutes'::interval) + } { + # Loop thru recently expired items, and flush the cached section + db_foreach expired_items { + select s.section_id + from ec_items i, dotlrn_ecommerce_section s + where i.product_id = s.product_id + and item_state = 'expired' + and expired_date > (current_timestamp - '10 minutes'::interval) + } { + util_memoize_flush [list dotlrn_ecommerce::section::attendees $section_id] + } + } +} + +ad_proc -public dotlrn_ecommerce::check_expired_orders_once { +} { + Reschedule checking of expired orders + + @author Roel Canicula (roelmc@pldtdsl.net) + @creation-date 2005-08-18 + + @return + + @error +} { + dotlrn_ecommerce::check_expired_orders + + ad_schedule_proc -thread t 600 dotlrn_ecommerce::check_expired_orders +} \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 24 Aug 2005 05:01:50 -0000 1.24 +++ openacs-4/packages/dotlrn-ecommerce/tcl/section-procs.tcl 25 Aug 2005 19:07:48 -0000 1.25 @@ -634,53 +634,6 @@ return [list] } -ad_proc -public dotlrn_ecommerce::section::check_expired_orders { -} { - Check recently expired orders in shopping cart and flush the cache - - @author Roel Canicula (roelmc@pldtdsl.net) - @creation-date 2005-08-18 - - @return - - @error -} { - # Loop thru recently expired orders - db_foreach expired_orders { - select order_id - from ec_orders - where order_state = 'expired' - and expired_date > (current_timestamp - '10 minutes'::interval) - } { - # Loop thru recently expired items, and flush the cached section - db_foreach expired_items { - select s.section_id - from ec_items i, dotlrn_ecommerce_section s - where i.product_id = s.product_id - and order_state = 'expired' - and expired_date > (current_timestamp - '10 minutes'::interval) - } { - util_memoize_flush [list dotlrn_ecommerce::section::attendees $section_id] - } - } -} - -ad_proc -public dotlrn_ecommerce::section::check_expired_orders_once { -} { - Reschedule checking of expired orders - - @author Roel Canicula (roelmc@pldtdsl.net) - @creation-date 2005-08-18 - - @return - - @error -} { - dotlrn_ecommerce::section::check_expired_orders - - ad_schedule_proc -thread t 600 dotlrn_ecommerce::section::check_expired_orders -} - ad_proc -public dotlrn_ecommerce::section::has_discount_p { product_id } {