MCPcopy Create free account
hub / github.com/SignTools/SignTools / Cleanup

Method Cleanup

src/storage/job_resolver.go:66–89  ·  view source on GitHub ↗
(timeout time.Duration)

Source from the content-addressed store, hash-verified

64}
65
66func (r *JobResolver) Cleanup(timeout time.Duration) {
67 r.mu.Lock()
68 defer r.mu.Unlock()
69 now := time.Now()
70 var deleteList []any
71 for el := r.appIdToSignJobMap.Front(); el != nil; el = el.Next() {
72 job := el.Value.(*signJob)
73 if now.After(job.ts.Add(timeout)) {
74 deleteList = append(deleteList, el.Key)
75 }
76 }
77 for _, key := range deleteList {
78 r.appIdToSignJobMap.Delete(key)
79 }
80 var deleteList2 []string
81 for id, job := range r.idToReturnJobMap {
82 if now.After(job.Ts.Add(timeout)) {
83 deleteList2 = append(deleteList2, id)
84 }
85 }
86 for _, id := range deleteList2 {
87 r.deleteById(id)
88 }
89}
90
91func (r *JobResolver) GetStatusByAppId(id string) (bool, bool) {
92 r.mu.Lock()

Callers 1

serveFunction · 0.45

Calls 3

deleteByIdMethod · 0.95
AddMethod · 0.80
DeleteMethod · 0.45

Tested by

no test coverage detected