Skip to content

Commit 9fe2ca3

Browse files
committed
Improve synchronization in ScheduledStateSnapshot retrieval
1 parent 198af0e commit 9fe2ca3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/at/sv/hue/ScheduledState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private int parseDateTimeBasedTransitionTime(ZonedDateTime definedStart) {
176176
/**
177177
* Returns the snapshot for the given dateTime. The snapshot is cached for 3 days.
178178
*/
179-
public ScheduledStateSnapshot getSnapshot(ZonedDateTime dateTime) {
179+
public synchronized ScheduledStateSnapshot getSnapshot(ZonedDateTime dateTime) {
180180
return snapshotCache.get(getDefinedStart(dateTime),
181181
definedStart -> new ScheduledStateSnapshot(this, definedStart, getGeneration(),
182182
previousStateLookup, nextStateLookup));

0 commit comments

Comments
 (0)