Fix utests

This commit is contained in:
Širhoe Biazhkovič
2021-09-05 17:32:31 +03:00
parent cb4ac3c7f8
commit 20f1a99ec2
6 changed files with 43 additions and 40 deletions

View File

@@ -11,6 +11,8 @@ import (
"github.com/chihaya/chihaya/bittorrent"
"github.com/chihaya/chihaya/middleware"
_ "github.com/chihaya/chihaya/middleware/torrentapproval/container/directory"
_ "github.com/chihaya/chihaya/middleware/torrentapproval/container/list"
)
// Name is the name by which this middleware is registered with Chihaya.
@@ -73,5 +75,8 @@ func (h *hook) HandleScrape(ctx context.Context, req *bittorrent.ScrapeRequest,
}
func (h *hook) Stop() stop.Result {
return h.hashContainer.Stop()
if st, isOk := h.hashContainer.(stop.Stopper); isOk{
return st.Stop()
}
return stop.AlreadyStopped
}