Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

keep scheduler selection by repeat entry from https://github.com/yacy/yacy_search_server/commit/07311020d47d42000d5d2488489a7927020739a9 to allow exec schedule on actual exec event. Iterate on exec date (of advantage after interruption/shutdown) to schedule older or missed events first.

reger70d47ae38a03
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index b5ccadbf7..dc3af0bf6 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -2198,15 +2198,22 @@ public final class Switchboard extends serverSwitch {
final Date now = new Date();
try {
final Iterator<Tables.Row> plainIterator = this.tables.iterator(WorkTables.TABLE_API_NAME);
- final Iterator<Tables.Row> mapIterator = Tables.orderBy(plainIterator, -1, WorkTables.TABLE_API_COL_DATE_RECORDING).iterator();
+ final Iterator<Tables.Row> mapIterator = Tables.orderBy(plainIterator, -1, WorkTables.TABLE_API_COL_DATE_LAST_EXEC).iterator();
while (mapIterator.hasNext()) {
row = mapIterator.next();
if (row == null) continue;
// select api calls according to scheduler settings
- final Date date_next_exec = row.get(WorkTables.TABLE_API_COL_DATE_NEXT_EXEC, (Date) null);
- if (date_next_exec != null && now.after(date_next_exec)) pks.add(UTF8.String(row.getPK()));
-
+ final int stime = row.get(WorkTables.TABLE_API_COL_APICALL_SCHEDULE_TIME, 0);
+ if (stime > 0) { // has scheduled repeat
+ final Date date_next_exec = row.get(WorkTables.TABLE_API_COL_DATE_NEXT_EXEC, (Date) null);
+ if (date_next_exec != null) { // has been executed before
+ if (now.after(date_next_exec)) pks.add(UTF8.String(row.getPK()));
+ } else { // was never executed before
+ pks.add(UTF8.String(row.getPK()));
+ }
+ }
+
// select api calls according to event settings
final String kind = row.get(WorkTables.TABLE_API_COL_APICALL_EVENT_KIND, "off");
if (!"off".equals(kind)) {