diff options
author | Anton Tananaev <anton@traccar.org> | 2024-07-28 09:00:14 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-07-28 09:00:14 -0700 |
commit | 0e1217d3b58528e87ffba2b7d81c3ce616afe128 (patch) | |
tree | 86ee93e4c8fb36909dc2a3a740d1287a3473c35f /src/main/java/org/traccar/schedule | |
parent | a1e4d899066c53a2468a0658426935726646755a (diff) | |
download | trackermap-server-0e1217d3b58528e87ffba2b7d81c3ce616afe128.tar.gz trackermap-server-0e1217d3b58528e87ffba2b7d81c3ce616afe128.tar.bz2 trackermap-server-0e1217d3b58528e87ffba2b7d81c3ce616afe128.zip |
Update calendar library
Diffstat (limited to 'src/main/java/org/traccar/schedule')
-rw-r--r-- | src/main/java/org/traccar/schedule/TaskReports.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/schedule/TaskReports.java b/src/main/java/org/traccar/schedule/TaskReports.java index 1b9b15749..32f6fea87 100644 --- a/src/main/java/org/traccar/schedule/TaskReports.java +++ b/src/main/java/org/traccar/schedule/TaskReports.java @@ -41,6 +41,8 @@ import org.traccar.storage.query.Condition; import org.traccar.storage.query.Request; import jakarta.inject.Inject; + +import java.time.Instant; import java.util.Collections; import java.util.Date; import java.util.HashSet; @@ -83,12 +85,12 @@ public class TaskReports extends SingleScheduleTask { var lastEvents = calendar.findPeriods(lastCheck); var currentEvents = calendar.findPeriods(currentCheck); - Set<Period> finishedEvents = new HashSet<>(lastEvents); + Set<Period<Instant>> finishedEvents = new HashSet<>(lastEvents); finishedEvents.removeAll(currentEvents); - for (Period period : finishedEvents) { + for (Period<Instant> period : finishedEvents) { RequestScoper scope = ServletScopes.scopeRequest(Collections.emptyMap()); try (RequestScoper.CloseableScope ignored = scope.open()) { - executeReport(report, period.getStart(), period.getEnd()); + executeReport(report, Date.from(period.getStart()), Date.from(period.getEnd())); } } } |