aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/schedule
diff options
context:
space:
mode:
authorAaron Donnelly <126603683+Aaron-Donnelly@users.noreply.github.com>2023-05-03 14:27:45 +0100
committerGitHub <noreply@github.com>2023-05-03 14:27:45 +0100
commit442806299eb328b5b41882d04c3dd65650715647 (patch)
treece471e548ade4a971ce1569ffa07661b49533e57 /src/main/java/org/traccar/schedule
parentbeb43ba371de5862a7ca6579daef20c8ffd83f2d (diff)
parentbb6964f03867d039a547c103cd16390f78688022 (diff)
downloadtrackermap-server-442806299eb328b5b41882d04c3dd65650715647.tar.gz
trackermap-server-442806299eb328b5b41882d04c3dd65650715647.tar.bz2
trackermap-server-442806299eb328b5b41882d04c3dd65650715647.zip
Merge branch 'traccar:master' into Teltonika-io30-faultCount
Diffstat (limited to 'src/main/java/org/traccar/schedule')
-rw-r--r--src/main/java/org/traccar/schedule/TaskReports.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/schedule/TaskReports.java b/src/main/java/org/traccar/schedule/TaskReports.java
index 004a6078c..176b6d537 100644
--- a/src/main/java/org/traccar/schedule/TaskReports.java
+++ b/src/main/java/org/traccar/schedule/TaskReports.java
@@ -18,7 +18,7 @@ package org.traccar.schedule;
import com.google.inject.Injector;
import com.google.inject.servlet.RequestScoper;
import com.google.inject.servlet.ServletScopes;
-import net.fortuna.ical4j.model.component.VEvent;
+import net.fortuna.ical4j.model.Period;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.model.BaseModel;
@@ -77,16 +77,14 @@ public class TaskReports implements ScheduleTask {
Calendar calendar = storage.getObject(Calendar.class, new Request(
new Columns.All(), new Condition.Equals("id", report.getCalendarId())));
- var lastEvents = calendar.findEvents(lastCheck);
- var currentEvents = calendar.findEvents(currentCheck);
+ var lastEvents = calendar.findPeriods(lastCheck);
+ var currentEvents = calendar.findPeriods(currentCheck);
if (!lastEvents.isEmpty() && currentEvents.isEmpty()) {
- VEvent event = lastEvents.iterator().next();
- Date from = event.getStartDate().getDate();
- Date to = event.getEndDate().getDate();
+ Period period = lastEvents.iterator().next();
RequestScoper scope = ServletScopes.scopeRequest(Collections.emptyMap());
try (RequestScoper.CloseableScope ignored = scope.open()) {
- executeReport(report, from, to);
+ executeReport(report, period.getStart(), period.getEnd());
}
}
}