Use worker pool extensively

This commit is contained in:
Ben Sarmiento
2023-11-30 00:40:26 +01:00
parent 6e54fa760b
commit 9e3760f275
5 changed files with 97 additions and 64 deletions

View File

@@ -97,7 +97,7 @@ func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *i
file.Link = "repair"
if c.EnableRepair() {
// log.Debugf("File %s is marked for repair", filepath.Base(file.Path))
t.SetChecksum("") // force a recheck
t.SetNewLatestState(intTor.EmptyState()) // force a recheck
}
http.Error(w, "File is not available", http.StatusNotFound)
return
@@ -181,7 +181,7 @@ func (gf *GetFile) streamFileToResponse(file *intTor.File, url string, w http.Re
file.Link = "repair"
if cfg.EnableRepair() {
// log.Debugf("File %s is marked for repair", filepath.Base(file.Path))
torMgr.SetChecksum("") // force a recheck
torMgr.SetNewLatestState(intTor.EmptyState()) // force a recheck
}
}
http.Error(w, "File is not available", http.StatusNotFound)
@@ -195,7 +195,7 @@ func (gf *GetFile) streamFileToResponse(file *intTor.File, url string, w http.Re
file.Link = "repair"
if cfg.EnableRepair() {
// log.Debugf("File %s is marked for repair", filepath.Base(file.Path))
torMgr.SetChecksum("") // force a recheck
torMgr.SetNewLatestState(intTor.EmptyState()) // force a recheck
}
}
http.Error(w, "File is not available", http.StatusNotFound)