-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Sleep half second is small. If mongoid not connect to replica set, it's like DDOS attack to mongo. Better solution is:
<pre>
def increase_retry_attempts(retries, ex)
retries += 1
raise ex if retries > Mongoid.max_retries_on_connection_failure
Kernel.sleep(retries) // against 0.5s
log_retry retries, ex
retries
end
</pre>
m.