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

Method refresh

src/storage/upload_resolver.go:22–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func (r *uploadResolver) refresh() error {
23 r.mu.Lock()
24 defer r.mu.Unlock()
25 files, err := os.ReadDir(uploadsPath)
26 if err != nil {
27 return errors.WithMessage(err, "read uploads dir")
28 }
29 files = util.RemoveHiddenDirs(files)
30 for _, file := range files {
31 if filepath.Ext(file.Name()) == ".info" {
32 continue
33 }
34 id := file.Name()
35 r.idToUploadMap[id] = loadUpload(id)
36 }
37 return nil
38}
39
40func loadUpload(id string) Upload {
41 return newUpload(id)

Callers

nothing calls this directly

Calls 3

RemoveHiddenDirsFunction · 0.92
loadUploadFunction · 0.85
ReadDirMethod · 0.65

Tested by

no test coverage detected