diff options
| author | pr0vieh <pr0vieh@gmail.com> | 2026-01-22 23:17:31 +0100 |
|---|---|---|
| committer | pr0vieh <pr0vieh@gmail.com> | 2026-01-23 01:41:56 +0100 |
| commit | 3863dde402f5437a2e6d6c70c25521fbbd43f223 (patch) | |
| tree | 4b125a64003ea3d515fc04be2ee75a878c2b7ef9 | |
| parent | da6410cfcedc1c6b7f34c2692c11a746d97adac8 (diff) | |
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); + } + } + } } } |
