Index: openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl,v diff -u -r1.10.2.3 -r1.10.2.4 --- openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 13 Mar 2003 14:25:37 -0000 1.10.2.3 +++ openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 9 May 2003 22:40:50 -0000 1.10.2.4 @@ -17,21 +17,7 @@ set n 0 - db_foreach timed_out_subscriptions { - select r.subscr_id, - r.timeout, - r.summary_context_id, - i.impl_name, - case when r.lastbuild = null - then 0 - else date_part('epoch',r.lastbuild) - end as lastbuild - from rss_gen_subscrs r, - acs_sc_impls i - where i.impl_id = r.impl_id - and (r.lastbuild is null - or now() - r.lastbuild > cast(r.timeout || ' seconds' as interval)) - } { + db_foreach timed_out_subscriptions {} { set lastupdate [acs_sc_call RssGenerationSubscriber lastUpdated \ $summary_context_id $impl_name] if { $lastupdate > $lastbuild } { @@ -50,14 +36,7 @@ } { set start [clock seconds] - db_1row subscr_info { - select i.impl_name, - r.summary_context_id - from acs_sc_impls i, - rss_gen_subscrs r - where r.subscr_id = :subscr_id - and i.impl_id = r.impl_id - } + db_1row subscr_info {} set datasource [acs_sc_call RssGenerationSubscriber datasource \ $summary_context_id $impl_name] @@ -94,12 +73,7 @@ } set last_ttb [expr [clock seconds] - $start] - db_dml update_timestamp " - update rss_gen_subscrs - set lastbuild = now(), - last_ttb = :last_ttb $extra_sql - where subscr_id = :subscr_id - " + db_dml update_timestamp {} } ad_proc -private rss_assert_dir path { @@ -121,27 +95,14 @@ ad_proc -private rss_gen_bind {} { Creates bindings for unbound implementations for RssGenerationSubscriber. } { - set contract_id [db_string get_contract_id { - select acs_sc_contract__get_id('RssGenerationSubscriber') - }] + set contract_id [db_string get_contract_id {}] - db_foreach get_unbound_impls { - select impl_id - from acs_sc_impls i - where impl_contract_name = 'RssGenerationSubscriber' - and not exists (select 1 - from acs_sc_bindings b - where b.impl_id = i.impl_id - and b.contract_id = :contract_id) - - } { + db_foreach get_unbound_impls {} { ns_log Notice "rss_gen_bind: binding impl $impl_id for contract $contract_id" # Don't ask me why, but bind variables don't appear to work # in this nested db operation. if [catch { - db_exec_plsql bind_impl " - select acs_sc_binding__new($contract_id,$impl_id) - " + db_exec_plsql bind_impl {} } errMsg] { ns_log Notice "rss_gen_bind: error binding impl $impl_id for contract $contract_id: $errMsg" } @@ -163,14 +124,7 @@ if ![info exists subscr_id] { error "rss_gen_report_dir needs either subscr_id or impl_id+summary_context_id" } else { - db_1row subscr_context_and_impl { - select s.summary_context_id, - i.impl_name - from rss_gen_subscrs s, - acs_sc_impls i - where i.impl_id = s.impl_id - and s.subscr_id = :subscr_id - } + db_1row subscr_context_and_impl {} } } @@ -193,22 +147,14 @@ or impl_name + summary_context_id provided. If the -assert flag is set, the parent directory is created if it doesn't exist - If the -url flag is set, return a url; otherwise - return a Unix file path. + @return a Unix file path. } { if {!([info exists summary_context_id] && \ [info exists impl_name])} { if ![info exists subscr_id] { error "rss_gen_report_file needs either subscr_id or impl_id+summary_context_id" } else { - db_1row subscr_context_and_impl { - select s.summary_context_id, - i.impl_name - from rss_gen_subscrs s, - acs_sc_impls i - where i.impl_id = s.impl_id - and s.subscr_id = :subscr_id - } + db_1row subscr_context_and_impl {} } }