Changes delay betweeen scheduler to fixed 3s

This commit is contained in:
litoral05
2026-06-01 12:08:28 +01:00
parent 109b226448
commit ba52c1516b
3 changed files with 15 additions and 3 deletions
@@ -76,7 +76,7 @@ public class AcquisitionSchedulerService {
System.out.println("Starting acquisition scheduler.");
taskScheduler.scheduleWithFixedDelay(
taskScheduler.scheduleAtFixedRate(
this::safePoll,
properties.getFixedDelayMillis()
);
@@ -96,13 +96,26 @@ public class AcquisitionSchedulerService {
runtimeStatus.setLastStartedAt(Instant.now());
runtimeStatus.setLastError(null);
long started = System.currentTimeMillis();
try {
AcquisitionPollResult result = blockPollingService.pollOnceByBlocks();
System.out.println(
"pollOnceByBlocks took "
+ (System.currentTimeMillis() - started)
+ " ms"
);
long wsStart = System.currentTimeMillis();
runtimeStatus.setLastSuccessfulReads(result.successfulReads());
runtimeStatus.setLastFailedReads(result.failedReads());
telemetryWebSocketPublisher.publishLatestTelemetry();
System.out.println(
"publishLatestTelemetry took "
+ (System.currentTimeMillis() - wsStart)
+ " ms"
);
DashboardOverviewResponse overview =
dashboardOverviewService.getOverview();
@@ -60,7 +60,6 @@ public class HistorianService {
sample.setNumericValue(value.doubleValue());
sample.setUnit(unit);
sample.setSource(SOURCE_MODULE);
System.out.println("Saving historian sample: " + keyName + " = " + value);
historianSampleRepository.save(sample);
}
+1 -1
View File
@@ -33,7 +33,7 @@ litoralregas:
acquisition:
scheduler:
enabled: true
fixed-delay-millis: 10000 # change here for longer wait between cycles
fixed-delay-millis: 3000 # change here for longer wait between cycles
weather:
enabled: true