From 7a23d33d0ebbae1a3d792502592dfb83eb70d150 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Fri, 6 May 2022 15:04:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=AF=84=E6=B5=8B=E9=BB=98?= =?UTF-8?q?=E8=AE=A48=E5=B0=8F=E6=97=B6=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/setting/setting.go | 10 ++++++---- routers/repo/cloudbrain.go | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index eee539d0c..2fd1a1b9c 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -478,10 +478,11 @@ var ( BenchmarkMaxDuration int64 //snn4imagenet config - IsSnn4imagenetEnabled bool - Snn4imagenetOwner string - Snn4imagenetName string - Snn4imagenetServerHost string + IsSnn4imagenetEnabled bool + Snn4imagenetOwner string + Snn4imagenetName string + Snn4imagenetServerHost string + ModelBenchmarkMaxDuration int64 //snn4imagenet config IsBrainScoreEnabled bool @@ -1309,6 +1310,7 @@ func NewContext() { Snn4imagenetOwner = sec.Key("OWNER").MustString("") Snn4imagenetName = sec.Key("NAME").MustString("") Snn4imagenetServerHost = sec.Key("HOST").MustString("") + ModelBenchmarkMaxDuration = sec.Key("MAX_DURATION").MustInt64(28800) sec = Cfg.Section("brainscore") IsBrainScoreEnabled = sec.Key("ENABLED").MustBool(false) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0520c2dbd..ab816c944 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -1397,6 +1397,8 @@ func SyncCloudbrainStatus() { var maxDuration int64 if task.JobType == string(models.JobTypeBenchmark) { maxDuration = setting.BenchmarkMaxDuration + } else if task.JobType == string(models.JobTypeSnn4imagenet) || task.JobType == string(models.JobTypeBrainScore) { + maxDuration = setting.ModelBenchmarkMaxDuration } else { maxDuration = setting.MaxDuration }