Changes delay betweeen scheduler to fixed 3s
This commit is contained in:
+14
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user