@@ -419,9 +419,9 @@ func buildMySQLJobListItem(logger g.LoggerType, jobParam *models.CreateOrUpdateM
419419 }
420420 logger .Debug ("buildJob" , "database" , jobParam .SrcTask .ConnectionConfig , "database2" , jobParam .DestTask .ConnectionConfig )
421421 jobInfo := common.JobListItemV2 {
422- JobId : jobParam .JobId ,
423- JobStatus : common .DtleJobStatusNonPaused ,
424- JobCreateTime : time .Now ().In (time .Local ).Format (time .RFC3339 ),
422+ JobId : jobParam .JobId ,
423+ JobStatus : common .DtleJobStatusNonPaused ,
424+ JobCreateTime : time .Now ().In (time .Local ).Format (time .RFC3339 ),
425425 SrcDatabaseType : jobParam .SrcTask .ConnectionConfig .DatabaseType ,
426426 DstDatabaseType : jobParam .DestTask .ConnectionConfig .DatabaseType ,
427427 SrcAddrList : []string {net .JoinHostPort (jobParam .SrcTask .ConnectionConfig .Host ,
@@ -516,18 +516,20 @@ func buildNomadTaskGroupItem(dtleTaskconfig map[string]interface{}, taskName, no
516516
517517func buildRestartPolicy (RestartAttempts int ) (* nomadApi.ReschedulePolicy , * nomadApi.RestartPolicy ) {
518518 // set default ReschedulePolicy and default RestartPolicy interval
519- // https://github.com/actiontech/dtle-docs-cn/blob/master/4/4.3_job_configuration.md#restart--reschedule
520- defaultRescheduleAttempts := 1
521- defaultRescheduleInterval := time .Duration (1800000000000 )
522- defaultRescheduleUnlimited := false
519+ // https://www.nomadproject.io/docs/job-specification/reschedule#exponential
520+ defaultRescheduleUnlimited := true
521+ defaultRescheduleDelay := 5 * time .Second
522+ defaultRescheduleMaxDelay := time .Minute
523+ defaultRescheduleDelayFunction := "exponential"
523524
524525 defaultRestartInterval := time .Duration (1800000000000 )
525526 defaultRestartMode := "fail"
526527
527528 return & nomadApi.ReschedulePolicy {
528- Attempts : & defaultRescheduleAttempts ,
529- Interval : & defaultRescheduleInterval ,
530- Unlimited : & defaultRescheduleUnlimited ,
529+ Unlimited : & defaultRescheduleUnlimited ,
530+ DelayFunction : & defaultRescheduleDelayFunction ,
531+ Delay : & defaultRescheduleDelay ,
532+ MaxDelay : & defaultRescheduleMaxDelay ,
531533 }, & nomadApi.RestartPolicy {
532534 Interval : & defaultRestartInterval ,
533535 Attempts : & RestartAttempts ,
@@ -737,10 +739,10 @@ func buildBasicTaskProfile(logger g.LoggerType, jobId string, srcTaskDetail *mod
737739 if srcTaskDetail .TaskConfig .MysqlSrcTaskConfig != nil {
738740 srcConfig .MysqlSrcTaskConfig = & models.MysqlSrcTaskConfig {
739741 ExpandSyntaxSupport : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .ExpandSyntaxSupport ,
740- Gtid : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .Gtid ,
741- BinlogRelay : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .BinlogRelay ,
742- WaitOnJob : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .WaitOnJob ,
743- AutoGtid : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .AutoGtid ,
742+ Gtid : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .Gtid ,
743+ BinlogRelay : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .BinlogRelay ,
744+ WaitOnJob : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .WaitOnJob ,
745+ AutoGtid : srcTaskDetail .TaskConfig .MysqlSrcTaskConfig .AutoGtid ,
744746 }
745747 } else if srcTaskDetail .TaskConfig .OracleSrcTaskConfig != nil {
746748 srcConfig .OracleSrcTaskConfig = & models.OracleSrcTaskConfig {
@@ -934,10 +936,10 @@ func buildSrcTaskDetail(taskName string, internalTaskConfig common.DtleTaskConfi
934936 connectionConfig .Password = internalTaskConfig .ConnectionConfig .Password
935937 srcTaskDetail .TaskConfig .MysqlSrcTaskConfig = & models.MysqlSrcTaskConfig {
936938 ExpandSyntaxSupport : internalTaskConfig .ExpandSyntaxSupport ,
937- AutoGtid : internalTaskConfig .AutoGtid ,
938- Gtid : internalTaskConfig .Gtid ,
939- BinlogRelay : internalTaskConfig .BinlogRelay ,
940- WaitOnJob : internalTaskConfig .WaitOnJob ,
939+ AutoGtid : internalTaskConfig .AutoGtid ,
940+ Gtid : internalTaskConfig .Gtid ,
941+ BinlogRelay : internalTaskConfig .BinlogRelay ,
942+ WaitOnJob : internalTaskConfig .WaitOnJob ,
941943 }
942944 }
943945 srcTaskDetail .TaskConfig .ConnectionConfig = connectionConfig
@@ -1875,10 +1877,10 @@ func ReverseJobV2(c echo.Context, filterJobType DtleJobType) error {
18751877
18761878 GroupTimeout : originalJob .BasicTaskProfile .Configuration .SrcConfig .GroupTimeout ,
18771879 MysqlSrcTaskConfig : & models.MysqlSrcTaskConfig {
1878- ExpandSyntaxSupport : originalJob .BasicTaskProfile .Configuration .SrcConfig .MysqlSrcTaskConfig .ExpandSyntaxSupport ,
1879- BinlogRelay : originalJob .BasicTaskProfile .Configuration .SrcConfig .MysqlSrcTaskConfig .BinlogRelay ,
1880- WaitOnJob : consulJobItem .JobId ,
1881- AutoGtid : true ,
1880+ ExpandSyntaxSupport : originalJob .BasicTaskProfile .Configuration .SrcConfig .MysqlSrcTaskConfig .ExpandSyntaxSupport ,
1881+ BinlogRelay : originalJob .BasicTaskProfile .Configuration .SrcConfig .MysqlSrcTaskConfig .BinlogRelay ,
1882+ WaitOnJob : consulJobItem .JobId ,
1883+ AutoGtid : true ,
18821884 },
18831885 }
18841886 reverseJobParam .DestTask = & models.DestTaskConfig {
0 commit comments