fix: InterruptedException processing compliant with SonarLint
This commit is contained in:
parent
82bf6b55cc
commit
d5d51869df
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,8 @@ import eu.ztsh.lfr.model.Average;
|
||||||
import eu.ztsh.lfr.model.Averages;
|
import eu.ztsh.lfr.model.Averages;
|
||||||
import eu.ztsh.lfr.model.events.FileProcessedEvent;
|
import eu.ztsh.lfr.model.events.FileProcessedEvent;
|
||||||
import jakarta.annotation.Nonnull;
|
import jakarta.annotation.Nonnull;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -13,6 +15,7 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class TemperaturesServiceImpl implements TemperaturesService {
|
public class TemperaturesServiceImpl implements TemperaturesService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(TemperaturesServiceImpl.class);
|
||||||
private Averages averages;
|
private Averages averages;
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -23,7 +26,8 @@ public class TemperaturesServiceImpl implements TemperaturesService {
|
||||||
try {
|
try {
|
||||||
wait();
|
wait();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new IllegalStateException(e);
|
log.error("Thread was interrupted", e);
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return averages.get(city);
|
return averages.get(city);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue