Skip to content

Exponential decay when requests fail#136

Merged
testower merged 4 commits intoentur:masterfrom
mobidata-bw:issues/lamassu_340_backoff
Jan 8, 2024
Merged

Exponential decay when requests fail#136
testower merged 4 commits intoentur:masterfrom
mobidata-bw:issues/lamassu_340_backoff

Conversation

@hbruch
Copy link
Copy Markdown
Collaborator

@hbruch hbruch commented Jan 5, 2024

This PR addresses entur/lamassu#340. It introduces an UpdateStrategy which schedules new requests depending on the number of previously failed request attempts, with a max delay of one hour.

To verify this behaviour, a unit tests is added, which asserts that immediately after a failing request the feed should not update. Note that this is a rather implicit blackbox test. I considered extracting UpdateStrategy to a proper class instead of a private nested class to do a whitebox test, but refrained from this as GBFSFeedUpdater is a private inner class also.

Note further, that I came across two questions regarding the current implementation, which probably should be addressed in another PR (or need not, depending on the current reasoning).

@testower
Copy link
Copy Markdown
Collaborator

testower commented Jan 5, 2024

Thanks for your contribution @hbruch! Regarding your questions, I think they are relevant when design the v2 loader api. I would very much like to discuss this with you when I get there. The UpdateStrategy will probably be continued in v2, but then as a public api, so that the strategy can be tweaked by the library user if desired.

@testower testower merged commit a009cf9 into entur:master Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants