ITeye博客

重试策略

yangbinfx · 2018-04-16 16:03 · C/C++ · 移动开发 · Markdown

<!-- 
#处理失败时的重试次数
orderTaskWorker.retryCount=100
#重试时的权重,算法为:当前时间 + (rate * retryCount) > 更新时间时,可执行 
orderTaskWorker.rate=100
-->

and RetryCount <= #retryCount# 
and UpdateTime < dateadd(n, #rate# * RetryCount, getdate())
<!--解锁重置次数加一 -->
<update id="unlockTask" parameterClass="java.lang.Long">
		update MayiTask
		set
		IsFinished = 0, RetryCount = RetryCount + 1, UpdateTime = getdate()
		where Id = #value# and IsFinished = 100
</update>
 

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。