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."); System.out.println("Starting acquisition scheduler.");
taskScheduler.scheduleWithFixedDelay( taskScheduler.scheduleAtFixedRate(
this::safePoll, this::safePoll,
properties.getFixedDelayMillis() properties.getFixedDelayMillis()
); );
@@ -96,13 +96,26 @@ public class AcquisitionSchedulerService {
runtimeStatus.setLastStartedAt(Instant.now()); runtimeStatus.setLastStartedAt(Instant.now());
runtimeStatus.setLastError(null); runtimeStatus.setLastError(null);
long started = System.currentTimeMillis();
try { try {
AcquisitionPollResult result = blockPollingService.pollOnceByBlocks(); AcquisitionPollResult result = blockPollingService.pollOnceByBlocks();
System.out.println(
"pollOnceByBlocks took "
+ (System.currentTimeMillis() - started)
+ " ms"
);
long wsStart = System.currentTimeMillis();
runtimeStatus.setLastSuccessfulReads(result.successfulReads()); runtimeStatus.setLastSuccessfulReads(result.successfulReads());
runtimeStatus.setLastFailedReads(result.failedReads()); runtimeStatus.setLastFailedReads(result.failedReads());
telemetryWebSocketPublisher.publishLatestTelemetry(); telemetryWebSocketPublisher.publishLatestTelemetry();
System.out.println(
"publishLatestTelemetry took "
+ (System.currentTimeMillis() - wsStart)
+ " ms"
);
DashboardOverviewResponse overview = DashboardOverviewResponse overview =
dashboardOverviewService.getOverview(); dashboardOverviewService.getOverview();
@@ -60,7 +60,6 @@ public class HistorianService {
sample.setNumericValue(value.doubleValue()); sample.setNumericValue(value.doubleValue());
sample.setUnit(unit); sample.setUnit(unit);
sample.setSource(SOURCE_MODULE); sample.setSource(SOURCE_MODULE);
System.out.println("Saving historian sample: " + keyName + " = " + value);
historianSampleRepository.save(sample); historianSampleRepository.save(sample);
} }
+1 -1
View File
@@ -33,7 +33,7 @@ litoralregas:
acquisition: acquisition:
scheduler: scheduler:
enabled: true 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: weather:
enabled: true enabled: true