|
|
|
@@ -1,15 +1,13 @@ |
|
|
|
package cloudbrainTask |
|
|
|
|
|
|
|
import ( |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
"time" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/cloudbrain" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/notification" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
) |
|
|
|
|
|
|
|
var noteBookOKMap = make(map[int64]int, 20) |
|
|
|
@@ -76,8 +74,7 @@ func isNoteBookReady(task *models.Cloudbrain) bool { |
|
|
|
noteBookFailMap[task.ID]=0 |
|
|
|
} |
|
|
|
|
|
|
|
waitingTime:=time.Now().Unix() - task.CreatedUnix.AsTime().Unix() |
|
|
|
if (count < successfulCount-1 || (noteBookFailMap[task.ID]==0 && count < maxSuccessfulCount-1)) && waitingTime<720{ |
|
|
|
if count < successfulCount-1 || (noteBookFailMap[task.ID]==0 && count < maxSuccessfulCount-1) { |
|
|
|
noteBookOKMap[task.ID] = count + 1 |
|
|
|
return false |
|
|
|
} else { |
|
|
|
|