Index: openacs-4/packages/news-aggregator/tcl/source-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/source-procs-postgresql.xql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/news-aggregator/tcl/source-procs-postgresql.xql 17 Jul 2018 15:48:54 -0000 1.8
+++ openacs-4/packages/news-aggregator/tcl/source-procs-postgresql.xql 18 Jul 2018 09:08:18 -0000 1.9
@@ -4,24 +4,6 @@
postgresql7.2
-
-
- where last_scanned < (now() - '00:48:00'::time)
-
-
-
-
-
- select source_id,
- feed_url,
- last_modified
- from na_sources
- $time_limit
- order by last_scanned asc
- $limit_sql
-
-
-
limit $limit
@@ -45,18 +27,6 @@
-
-
- now()
-
-
-
-
-
- :pub_date
-
-
-
select na_item__new (
@@ -90,10 +60,7 @@
- select na_source__delete(
- :source_id
- );
-
+ select na_source__delete(:source_id);
Index: openacs-4/packages/news-aggregator/tcl/source-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/source-procs.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/news-aggregator/tcl/source-procs.tcl 17 Jul 2018 15:48:54 -0000 1.15
+++ openacs-4/packages/news-aggregator/tcl/source-procs.tcl 18 Jul 2018 09:08:18 -0000 1.16
@@ -81,12 +81,14 @@
}
-ad_proc -public news_aggregator::source::get_identifier {
+ad_proc -deprecated -public news_aggregator::source::get_identifier {
{-guid:required}
{-link:required}
{-domain:required}
{-description:required}
} {
+ Deprecated: this proc has no usage in current uptsream codebase.
+} {
if { $guid ne "" } {
return guid
} elseif { $link ne ""
@@ -272,6 +274,8 @@
ad_proc -public news_aggregator::source::delete {
{-source_id:required}
} {
+ Delete a news source.
+} {
db_exec_plsql delete_source {}
}
@@ -281,37 +285,38 @@
@author Simon Carstensen (simon@bcuni.net)
@author Guan Yang (guan@unicast.org)
- Update sources by a one hour interval.
+ Update sources.
- @param all_sources Update every source. Normally this proc
- will only update the 25% of the existing sources.
+ @param all_sources Update every source. Normally this proc will
+ only update the 25% of the existing sources and
+ limit to those that were scanned earlier than
+ '48' minutes ago
} {
ns_log Notice "Updating news aggregator sources"
- ds_comment "test"
db_transaction {
- set source_count [db_string source_count ""]
+ set source_count [db_string source_count {
+ select count(*) from na_sources
+ }]
if { $source_count >= 1 } {
if { !$all_sources_p } {
- set limit [expr {int($source_count/4)}]
- if { $limit < 1 } {
- set limit 1
- }
+ set limit [expr {max(1, int($source_count/4))}]
set limit_sql [db_map sources_limit]
} else {
set limit_sql ""
}
- if { !$all_sources_p } {
- set time_limit [db_map time_limit]
- } else {
- set time_limit {}
- }
-
- set sources [db_list_of_lists sources ""]
- foreach source $sources {
+ foreach source [db_list_of_lists sources [subst {
+ select source_id,
+ feed_url,
+ last_modified
+ from na_sources
+ where :all_sources_p or
+ last_scanned < (current_timestamp - interval '48 minutes')
+ order by last_scanned asc
+ $limit_sql
+ }]] {
lassign $source source_id feed_url last_modified
-
news_aggregator::source::update \
-source_id $source_id \
-feed_url $feed_url \
Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/tcl/source-procs.xql'.
Fisheye: No comparison available. Pass `N' to diff?