英文:
Server receives request and processes it but Retrofit Android timesouts and fails because of bad internet
问题
我意识到有时候通过 Retrofit 发出请求时会因为超时而失败,但服务器似乎会记录并插入收集到的数据。这使得处理重试变得非常棘手(在我作为初学者开发者的角度),因为相同的数据可能会被插入两次,或者您可能不得不向用户提供错误的响应,因为即使请求失败但数据实际上已经被提交了。
英文:
I have realized that sometimes when I make a request through Retrofit it fails because of timeout but the server seems to log and insert the data collected. It makes handling retry's very tough (in my perspective as a novice developer) since the same data could be inserted twice or you might have to give the user wrong responses because if failed even though it went through.
专注分享java语言的经验与见解,让所有开发者获益!
评论