feat: add outbound WCS retry dispatch
This commit is contained in:
@@ -60,6 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where job_id = #{jobId}
|
||||
and version_no = #{versionNo}
|
||||
and dispatch_status in ('PENDING', 'BLOCKED', 'RETRY_WAIT', 'EXHAUSTED', 'SENDING')
|
||||
and (dispatch_status != 'SENDING'
|
||||
or last_attempt_time <= dateadd(minute, -5, #{attemptTime}))
|
||||
and (#{trigger} != 'AUTO_RETRY' or auto_retry_count < 5)
|
||||
</update>
|
||||
|
||||
@@ -67,27 +69,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update wcs_job_dispatch
|
||||
set dispatch_status = 'BLOCKED', last_error = #{lastError}, next_retry_time = #{nextRetryTime},
|
||||
update_time = #{updateTime}, version_no = version_no + 1
|
||||
where job_id = #{jobId} and dispatch_status != 'SUCCESS'
|
||||
where job_id = #{jobId}
|
||||
and version_no = #{versionNo}
|
||||
and dispatch_status != 'SUCCESS'
|
||||
</update>
|
||||
|
||||
<update id="markRetryWait" parameterType="map">
|
||||
update wcs_job_dispatch
|
||||
set dispatch_status = 'RETRY_WAIT', last_error = #{lastError}, next_retry_time = #{nextRetryTime},
|
||||
update_time = #{updateTime}, version_no = version_no + 1
|
||||
where job_id = #{jobId} and dispatch_status = 'SENDING'
|
||||
where job_id = #{jobId}
|
||||
and version_no = #{versionNo}
|
||||
and dispatch_status = 'SENDING'
|
||||
</update>
|
||||
|
||||
<update id="markSuccess" parameterType="map">
|
||||
update wcs_job_dispatch
|
||||
set dispatch_status = 'SUCCESS', last_error = null, next_retry_time = null,
|
||||
success_time = #{successTime}, update_time = #{successTime}, version_no = version_no + 1
|
||||
where job_id = #{jobId} and dispatch_status = 'SENDING'
|
||||
where job_id = #{jobId}
|
||||
and version_no = #{versionNo}
|
||||
and dispatch_status = 'SENDING'
|
||||
</update>
|
||||
|
||||
<update id="markExhausted" parameterType="map">
|
||||
update wcs_job_dispatch
|
||||
set dispatch_status = 'EXHAUSTED', last_error = #{lastError}, next_retry_time = null,
|
||||
update_time = #{updateTime}, version_no = version_no + 1
|
||||
where job_id = #{jobId} and dispatch_status = 'SENDING'
|
||||
where job_id = #{jobId}
|
||||
and version_no = #{versionNo}
|
||||
and dispatch_status in ('SENDING', 'BLOCKED', 'RETRY_WAIT')
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user