Various improvements #17

Merged
Seil0 merged 11 commits from :fix/timeout-resilience into master 2021-10-24 14:38:13 +02:00
Collaborator

While this pull request also includes some small improvements, the main change can be found in the Timetable fixes commit.

As of now, the weekNumberYear didn't get updated through the scheduled updates. Also, if a timeout occurs on the scheduled update, the existing data is overwritten. I don't see a good reason for that. That's why I changed it accordingly.

While this pull request also includes some small improvements, the main change can be found in the Timetable fixes commit. As of now, the weekNumberYear didn't get updated through the scheduled updates. Also, if a timeout occurs on the scheduled update, the existing data is overwritten. I don't see a good reason for that. That's why I changed it accordingly.
hannesbraun added 7 commits 2021-10-13 16:44:24 +02:00
- Only one request is made to get the timetable HTML document for parsing the timetable and the weekNumberYear
- On timeouts or other errors, the cached data won't be overwritten with emptiness anymore
- The scheduled updates will now also update the weekNumberYear
This also replaces JCenter with Maven Central since JCenter is now read-only
- Improve formatting
- Fix some typos
- Mini code improvements
Owner

please rebase onto master

please rebase onto master
hannesbraun force-pushed fix/timeout-resilience from f98dc3d808 to 6f4cb9fd66 2021-10-13 22:22:22 +02:00 Compare
hannesbraun added 1 commit 2021-10-14 00:32:36 +02:00
Multiple requests may be processed at the same time and could otherwise cause problems (concurrent write operations)
hannesbraun added 1 commit 2021-10-15 20:08:11 +02:00
Otherwise, the requests may fail (from my experience). Also we don't want to look suspicious (flooding their server with tons of requests at the same time).
hannesbraun added 1 commit 2021-10-16 01:08:59 +02:00
Seil0 requested changes 2021-10-23 12:58:05 +02:00
@ -35,0 +42,4 @@
val semaphore = Semaphore(3, 0)
}
private val htmlDoc: Document? =
Owner

please us ?.let { ... } for null safety. Something like this:

private val htmlDoc: Document? = htmlDoc ?: timetableURL?.let {
    runBlocking {
        ...
    }
}
please us `?.let { ... }` for null safety. Something like this: ```kotlin private val htmlDoc: Document? = htmlDoc ?: timetableURL?.let { runBlocking { ... } } ```
Author
Collaborator

This should be fixed with ca14a5d2f6

This should be fixed with ca14a5d2f6
hannesbraun marked this conversation as resolved
hannesbraun added 1 commit 2021-10-23 13:50:20 +02:00
Seil0 approved these changes 2021-10-23 13:56:07 +02:00
Seil0 left a comment
Owner

lgtm

lgtm
hannesbraun added 11 commits 2021-10-24 14:34:33 +02:00
- Only one request is made to get the timetable HTML document for parsing the timetable and the weekNumberYear
- On timeouts or other errors, the cached data won't be overwritten with emptiness anymore
- The scheduled updates will now also update the weekNumberYear
This also replaces JCenter with Maven Central since JCenter is now read-only
- Improve formatting
- Fix some typos
- Mini code improvements
Multiple requests may be processed at the same time and could otherwise cause problems (concurrent write operations)
Otherwise, the requests may fail (from my experience). Also we don't want to look suspicious (flooding their server with tons of requests at the same time).
Seil0 merged commit dc57a0d0c1 into master 2021-10-24 14:38:13 +02:00
Sign in to join this conversation.
No description provided.