1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

Add MirrorStatus.LastStarted property

- status.Status is in PreSyncing, and
- curStatus.Status is not in PreSyncing
这个提交包含在:
Phy
2020-04-04 22:34:07 -04:00
父节点 b8edc1f714
当前提交 c1641b6714
共有 6 个文件被更改,包括 116 次插入85 次删除

查看文件

@@ -297,14 +297,21 @@ func (s *Manager) updateJobOfWorker(c *gin.Context) {
curStatus, _ := s.adapter.GetMirrorStatus(workerID, mirrorName)
curTime := time.Now()
if status.Status == PreSyncing && curStatus.Status != PreSyncing {
status.LastStarted = curTime
} else {
status.LastStarted = curStatus.LastStarted
}
// Only successful syncing needs last_update
if status.Status == Success {
status.LastUpdate = time.Now()
status.LastUpdate = curTime
} else {
status.LastUpdate = curStatus.LastUpdate
}
if status.Status == Success || status.Status == Failed {
status.LastEnded = time.Now()
status.LastEnded = curTime
} else {
status.LastEnded = curStatus.LastEnded
}