Right so this is quite a big change, both in size and behaviour. Sorry about the size but there wasn't really an intermediary.
This adds repository interfaces, and mock repository implementations that currently use hash maps. The EntityServiceImpl now hits the repositories instead of the LichessDataService. There's a scheduled task that runs every 60 minutes (and at start up) that uses the LichessDataService, saving the new Lichess data to the repositories.
There's quite a few questions here and things that need unit testing:
How should we handle a 429? At the moment we just throw an expception. We'll start again in 60 minutes, and start back up with whatever latest information we persisted.
How do we handle general exceptions? We don't want unexpected errors to crash the process, and cause 60 minutes wait? Should we have a retry if it fails? What is sensible logic for that?
Right so this is quite a big change, both in size and behaviour. Sorry about the size but there wasn't really an intermediary.
This adds repository interfaces, and mock repository implementations that currently use hash maps. The EntityServiceImpl now hits the repositories instead of the LichessDataService. There's a scheduled task that runs every 60 minutes (and at start up) that uses the LichessDataService, saving the new Lichess data to the repositories.
There's quite a few questions here and things that need unit testing: