The early return in update_config (to deal with empty content when the config hasn't changed)
if content == b"":
return False
results in this error
BadRequestException('An error occurred (BadRequestException) when calling the GetLatestConfiguration operation: Request too early')
if the next call to update_config happens soon enough after this call.
The reason the exception is raised by get_latest_configuration is that this ealy return fails to update the variable (self._last_update_time) used to guard against calling before the negotiated minimum poll set via the RequiredMinimumPollIntervalInSeconds arg to start_configuration_session.
Changing the code to
if content == b"":
self._last_update_time = time.time()
return False
The early return in
update_config
(to deal with empty content when the config hasn't changed)results in this error
if the next call to
update_config
happens soon enough after this call.The reason the exception is raised by
get_latest_configuration
is that this ealy return fails to update the variable (self._last_update_time
) used to guard against calling before the negotiated minimum poll set via theRequiredMinimumPollIntervalInSeconds
arg tostart_configuration_session
.Changing the code to
would fix this problem.