wip: replace some references to the old prototype

This commit is contained in:
Michael Hohn
2024-05-20 14:01:19 -07:00
committed by =Michael Hohn
parent 1f52a0ab37
commit ccf064fe6c
2 changed files with 28 additions and 9 deletions

View File

@@ -16,8 +16,11 @@ import (
)
var (
mutex sync.Mutex
jobs map[int][]co.AnalyzeJob = make(map[int][]co.AnalyzeJob)
info map[co.JobSpec]co.JobInfo = make(map[co.JobSpec]co.JobInfo)
status map[co.JobSpec]co.Status = make(map[co.JobSpec]co.Status)
result map[co.JobSpec]co.AnalyzeResult = make(map[co.JobSpec]co.AnalyzeResult)
mutex sync.Mutex
)
type StorageSingle struct {
@@ -174,3 +177,21 @@ func PackageResults(ar co.AnalyzeResult, owre co.OwnerRepo, vaid int) (zipPath s
}
return zpath, nil
}
func GetJobList(sessionid int) []co.AnalyzeJob {
mutex.Lock()
defer mutex.Unlock()
return jobs[sessionid]
}
func GetJobInfo(js co.JobSpec) co.JobInfo {
mutex.Lock()
defer mutex.Unlock()
return info[js]
}
func GetStatus(sessionid int, orl co.OwnerRepo) co.Status {
mutex.Lock()
defer mutex.Unlock()
return status[co.JobSpec{ID: sessionid, OwnerRepo: orl}]
}