Skip to content

Commit

Permalink
Add missions cache and disable chat in side window
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Sep 25, 2024
1 parent 6bf3dc7 commit 444d4ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import fr.gouv.cnsp.monitorfish.domain.repositories.MissionActionsRepository
import fr.gouv.cnsp.monitorfish.domain.repositories.MissionRepository
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.cache.annotation.Cacheable
import java.time.ZonedDateTime

/**
Expand All @@ -20,6 +21,7 @@ class GetAllMissions(
) {
private val logger: Logger = LoggerFactory.getLogger(GetAllMissions::class.java)

@Cacheable(value = ["missions"])
fun execute(
pageNumber: Int?,
pageSize: Int?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class CaffeineConfiguration {

// Missions
val missionControlUnits = "mission_control_units"
val missions = "missions"

// Ports
val activePorts = "active_ports"
Expand Down Expand Up @@ -123,6 +124,7 @@ class CaffeineConfiguration {

// Missions
val missionControlUnitsCache = buildMinutesCache(missionControlUnits, ticker, 120)
val missionsCache = buildMinutesCache(missions, ticker, 1)

// Ports
val portsCache = buildMinutesCache(ports, ticker, oneWeek)
Expand Down Expand Up @@ -191,6 +193,7 @@ class CaffeineConfiguration {
logbookCache,
logbookRawMessageCache,
missionControlUnitsCache,
missionsCache,
nextLogbookCache,
pnoTypesCache,
logbookPnoTypesCache,
Expand Down
13 changes: 10 additions & 3 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
})();
</script>
<!-- End Matomo Code -->

<!-- This script is used to inject the chat in the main window -->
<script>
if (window.location.pathname !== "/side_window") {
let script = document.createElement('script')
script.src = "https://embed.small.chat/T0176BBUCEQC01SV3W4464.js"
script.async = true
document.head.appendChild(script)
}
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand All @@ -42,9 +52,6 @@
g.async=true; g.src='https://audience-sites.e2.rie.gouv.fr/js/container_JF5tSs4R.js'; s.parentNode.insertBefore(g,s);
</script>
<!-- End Matomo Tag Manager -->

<!-- This script is used to inject the chat -->
<script async src="https://embed.small.chat/T0176BBUCEQC01SV3W4464.js"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

0 comments on commit 444d4ff

Please sign in to comment.