diff options
| author | Michael Christen <Orbiter@users.noreply.github.com> | 2026-01-25 19:01:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-25 19:01:33 +0100 |
| commit | fb7367ed5586f8730d7ddc578963027d48d1ef9c (patch) | |
| tree | 122e99caf38e143d3e4458df4337b5487f4d1570 | |
| parent | ebf739769169f637537a076d3c6a7567ea96c8bf (diff) | |
| parent | 3863dde402f5437a2e6d6c70c25521fbbd43f223 (diff) | |
Merge pull request #757 from pr0vieh/fix/745-persist-recrawl-job
Persist recrawl job to restart on peer boot
| -rw-r--r-- | source/net/yacy/htroot/IndexReIndexMonitor_p.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/net/yacy/htroot/IndexReIndexMonitor_p.java b/source/net/yacy/htroot/IndexReIndexMonitor_p.java index ca31064b9..4c427fbba 100644 --- a/source/net/yacy/htroot/IndexReIndexMonitor_p.java +++ b/source/net/yacy/htroot/IndexReIndexMonitor_p.java @@ -165,6 +165,18 @@ public class IndexReIndexMonitor_p { } sb.tables.recordAPICall(post, IndexReIndexMonitor_p.SERVLET_NAME, WorkTables.TABLE_API_TYPE_CRAWLER, "Recrawl documents matching selection query : " + recrawlQuery); + /* Ensure the recrawl job restarts on peer reboot */ + final Row recrawlCall = WorkTables.selectLastExecutedApiCall(IndexReIndexMonitor_p.SERVLET_NAME, post, sb); + if (recrawlCall != null) { + recrawlCall.put(WorkTables.TABLE_API_COL_APICALL_EVENT_KIND, "regular"); + recrawlCall.put(WorkTables.TABLE_API_COL_APICALL_EVENT_ACTION, "startup"); + WorkTables.calculateAPIScheduler(recrawlCall, false); + try { + sb.tables.update(WorkTables.TABLE_API_NAME, recrawlCall); + } catch (final IOException e) { + ConcurrentLog.logException(e); + } + } } } else if(post.containsKey("simulateRecrawl")) { final SolrConnector solrConnector = sb.index.fulltext().getDefaultConnector(); @@ -207,6 +219,19 @@ public class IndexReIndexMonitor_p { * because we want to be able to provide a report after its termination */ recrawlbt.terminate(false); prop.put("recrawljobrunning", 0); + if (sb.tables != null) { + final Row recrawlCall = WorkTables.selectLastExecutedApiCall(IndexReIndexMonitor_p.SERVLET_NAME, post, sb); + if (recrawlCall != null) { + recrawlCall.put(WorkTables.TABLE_API_COL_APICALL_EVENT_KIND, "off"); + recrawlCall.put(WorkTables.TABLE_API_COL_APICALL_EVENT_ACTION, "startup"); + recrawlCall.put(WorkTables.TABLE_API_COL_DATE_NEXT_EXEC, ""); + try { + sb.tables.update(WorkTables.TABLE_API_NAME, recrawlCall); + } catch (final IOException e) { + ConcurrentLog.logException(e); + } + } + } } } |
