Authored by qinchao

docker支持集群回滚

... ... @@ -11,7 +11,7 @@ import java.util.List;
* Created by craig.qin
*/
public interface DockerJenkinsRecordMapper {
List<DockerJenkinsRecord> selectThreeMinutes();
List<DockerJenkinsRecord> selectBeforeSomeMinutes();
DockerJenkinsRecord selectById(@Param("id") String id);
int insert(DockerJenkinsRecord dockerJenkinsRecord);
int updateJob(@Param("id") String id ,@Param("jobId") String jobId,@Param("jobStatus")String jobStatus);
... ...
... ... @@ -27,11 +27,11 @@
where id= #{id}
</select>
<select id="selectThreeMinutes" resultMap="BaseResultMap">
<select id="selectBeforeSomeMinutes" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from docker_jenkins_record
where update_callback_time>=DATE_SUB(NOW(),INTERVAL 10 MINUTE)
where update_callback_time>=DATE_SUB(NOW(),INTERVAL 15 MINUTE)
</select>
... ...
... ... @@ -116,8 +116,8 @@ public class DockerMonitorTask {
boolean alarmFlag=true;
logger.info("DockerMonitorTask status is {} ", status);
//从docker发布记录中检索,10分钟内的数据
List<DockerJenkinsRecord> records=dockerJenkinsRecordMapper.selectThreeMinutes();
//从docker发布记录中检索,15分钟内的数据
List<DockerJenkinsRecord> records=dockerJenkinsRecordMapper.selectBeforeSomeMinutes();
if(records!=null&&records.size()>0){
logger.info("DockerMonitorTask record is {} ", JSON.toJSONString(records));
for(DockerJenkinsRecord record:records){
... ...