mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-10-06 07:32:38 +02:00
Compare commits
2 Commits
deploy-023
...
deploy-023
Author | SHA1 | Date | |
---|---|---|---|
|
0882a6d9cd | ||
|
5020029c2d |
@@ -50,7 +50,7 @@ public class PingJobScheduler {
|
||||
this.pingDao = pingDao;
|
||||
}
|
||||
|
||||
public synchronized void start(boolean startPaused) {
|
||||
public synchronized void start() {
|
||||
if (running)
|
||||
return;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PingJobScheduler {
|
||||
logger.info("PingJobScheduler paused");
|
||||
}
|
||||
|
||||
public synchronized void resume(int nodeId) {
|
||||
public synchronized void enableForNode(int nodeId) {
|
||||
logger.info("Resuming PingJobScheduler for nodeId: {}", nodeId);
|
||||
if (this.nodeId != null) {
|
||||
logger.warn("Attempted to resume PingJobScheduler with mismatched nodeId: expected {}, got {}", this.nodeId, nodeId);
|
||||
|
@@ -52,7 +52,8 @@ public class PingMain extends ProcessMainClass {
|
||||
log.info("Starting PingMain...");
|
||||
|
||||
// Start the ping job scheduler
|
||||
pingJobScheduler.start(true);
|
||||
pingJobScheduler.start();
|
||||
pingJobScheduler.enableForNode(node);
|
||||
|
||||
log.info("PingMain started successfully.");
|
||||
}
|
||||
|
@@ -50,7 +50,12 @@ public class RetryStrategy implements HttpRequestRetryStrategy {
|
||||
|
||||
if (statusCode == 429) {
|
||||
// get the Retry-After header
|
||||
String retryAfter = response.getFirstHeader("Retry-After").getValue();
|
||||
var retryAfterHeader = response.getFirstHeader("Retry-After");
|
||||
if (retryAfterHeader == null) {
|
||||
return TimeValue.ofSeconds(3);
|
||||
}
|
||||
|
||||
String retryAfter = retryAfterHeader.getValue();
|
||||
if (retryAfter == null) {
|
||||
return TimeValue.ofSeconds(2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user