Github user emlaver commented on a diff in the pull request:
https://github.com/apache/bahir/pull/49#discussion_r135038265
--- Diff:
sql-cloudant/src/main/scala/org/apache/bahir/cloudant/common/JsonStoreDataAccess.scala
---
@@ -125,6 +125,19 @@ class JsonStoreDataAccess (config: CloudantConfig) {
val clRequest: HttpRequest = getClRequest(url, postData)
val clResponse: HttpResponse[String] = clRequest.execute()
+
+ //BAHIR-130 start
+ //In cloudant Lite number of requests pre second are limited.
+ //Just wait and try again
+ clResponse.code match {
+ case 429 => {
+ Thread sleep 1000
--- End diff --
If the server is busy, we don't want this to loop and keep trying forever.
We should have a set number of retries (our other Cloudant java library uses 3
retries) and exit with a 429 error if we reach that limit.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---