Skip to content

Commit 0fc31ce

Browse files
committed
Updates cache key for onibusPorLinha
Updates the cache key for the "onibusPorLinha" cache to include the "sentido" parameter. This change ensures that the cache distinguishes between different directions for the same bus line, improving cache accuracy.
1 parent 7183a30 commit 0fc31ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/dmware/api_onibusbh/services/OnibusService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public List<OnibusDTO> listarTodosOnibus() {
5959
}).collect(Collectors.toList());
6060
}
6161

62-
@Cacheable(value = "onibusPorLinha", key = "#numeroLinha")
62+
@Cacheable(value = "onibusPorLinha", key = "{#numeroLinha, #sentido}")
6363
public List<CoordenadaDTO> listarPorNumeroLinha(Integer numeroLinha, Optional<Integer> sentido) {
6464
Optional<LinhaEntity> linha = linhasRepository.findByNumeroLinha(numeroLinha);
6565

0 commit comments

Comments
 (0)