fix for scheduling of rss feeds

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7247 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 7cd9d9d22a
commit e8f90201a5

@ -289,7 +289,7 @@ public class Load_RSS_p {
if (record_api && rss != null && rss.getFeed() != null && rss.getFeed().getChannel() != null) { if (record_api && rss != null && rss.getFeed() != null && rss.getFeed().getChannel() != null) {
// record API action // record API action
RSSLoader.recordAPI(sb, url, rss.getFeed(), repeat_time, repeat_unit); RSSLoader.recordAPI(sb, post.get(WorkTables.TABLE_API_COL_APICALL_PK, null), url, rss.getFeed(), repeat_time, repeat_unit);
} }
// show items from rss // show items from rss

@ -74,7 +74,7 @@ public class RSSLoader extends Thread {
indexAllRssFeed(sb, urlf, feed); indexAllRssFeed(sb, urlf, feed);
// add the feed also to the scheduler // add the feed also to the scheduler
recordAPI(sb, urlf, feed, 7, "seldays"); recordAPI(sb, null, urlf, feed, 7, "seldays");
} }
public static void indexAllRssFeed(Switchboard sb, DigestURI url, RSSFeed feed) { public static void indexAllRssFeed(Switchboard sb, DigestURI url, RSSFeed feed) {
@ -119,12 +119,13 @@ public class RSSLoader extends Thread {
} }
public static void recordAPI(Switchboard sb, DigestURI url, RSSFeed feed, int repeat_time, String repeat_unit) { public static void recordAPI(Switchboard sb, String apicall_pk, DigestURI url, RSSFeed feed, int repeat_time, String repeat_unit) {
// record API action // record API action
byte[] pk = null; byte[] pk = null;
serverObjects post = new serverObjects(); serverObjects post = new serverObjects();
post.put("url", url.toNormalform(true, false)); post.put("url", url.toNormalform(true, false));
post.put("indexAllItemContent", ""); post.put("indexAllItemContent", "");
if (apicall_pk != null) post.put(WorkTables.TABLE_API_COL_APICALL_PK, apicall_pk);
if (repeat_time > 0) { if (repeat_time > 0) {
// store as scheduled api call // store as scheduled api call
pk = sb.tables.recordAPICall(post, "Load_RSS_p.html", WorkTables.TABLE_API_TYPE_CRAWLER, "import feed " + url.toNormalform(true, false), repeat_time, repeat_unit.substring(3)); pk = sb.tables.recordAPICall(post, "Load_RSS_p.html", WorkTables.TABLE_API_TYPE_CRAWLER, "import feed " + url.toNormalform(true, false), repeat_time, repeat_unit.substring(3));

Loading…
Cancel
Save