In its current form the LichessDataService does quite a few things:
Fetches data from the lichess API
Reads the latest fetched games/players to cut down the number of requests we make.
Saves the latest fetched games/player at the end of an update.
Saves the games/players fetched.
Returns the latest games/players from the method.
I think this is getting to be too much work for one class, but the most distracting thing is that the methods return the list, as well as having the side effect of saving the new items. These methods should be changed to void - OR - move the responsibility of most of the above into the LichessDataScheduler, and have the LichessDataService simply fetch, and return items.
In its current form the LichessDataService does quite a few things:
I think this is getting to be too much work for one class, but the most distracting thing is that the methods return the list, as well as having the side effect of saving the new items. These methods should be changed to void - OR - move the responsibility of most of the above into the LichessDataScheduler, and have the LichessDataService simply fetch, and return items.