Skip to content

Commit

Permalink
matching: close connection to cache on stop() 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Oct 21, 2024
1 parent 8f5162f commit aecc72b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/caching.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ const createCache = async (opt = {}) => {
// const timePassed = Math.round(performance.now() - t0)
}

const stop = async () => {
await redis.quit()
}

return {
get,
put,
stop,
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/match-with-schedule-trip.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ const createMatchGtfsRtTripUpdateWithScheduleStopTimes = async (cfg, opt = {}) =
const stop = async () => {
await pg.end()
await stopQueryingStationWeight()
await cache.stop()
}

return {
Expand Down

0 comments on commit aecc72b

Please sign in to comment.