mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-11 02:58:11 -07:00
mv pkg/stopper pkg/stop
This makes most of the callsites stutter slightly less.
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/chihaya/chihaya/bittorrent"
|
||||
"github.com/chihaya/chihaya/middleware"
|
||||
"github.com/chihaya/chihaya/pkg/stopper"
|
||||
"github.com/chihaya/chihaya/pkg/stop"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -114,7 +114,7 @@ func (h *hook) Stop() <-chan error {
|
||||
log.Debug("attempting to shutdown JWT middleware")
|
||||
select {
|
||||
case <-h.closing:
|
||||
return stopper.AlreadyStopped
|
||||
return stop.AlreadyStopped
|
||||
default:
|
||||
}
|
||||
c := make(chan error)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/chihaya/chihaya/bittorrent"
|
||||
"github.com/chihaya/chihaya/frontend"
|
||||
"github.com/chihaya/chihaya/pkg/stopper"
|
||||
"github.com/chihaya/chihaya/pkg/stop"
|
||||
"github.com/chihaya/chihaya/storage"
|
||||
)
|
||||
|
||||
@@ -104,18 +104,18 @@ func (l *Logic) AfterScrape(ctx context.Context, req *bittorrent.ScrapeRequest,
|
||||
|
||||
// Stop stops the Logic.
|
||||
//
|
||||
// This stops any hooks that implement stopper.Stopper.
|
||||
// This stops any hooks that implement stop.stop.
|
||||
func (l *Logic) Stop() []error {
|
||||
stopGroup := stopper.NewStopGroup()
|
||||
stopGroup := stop.NewGroup()
|
||||
for _, hook := range l.preHooks {
|
||||
stoppable, ok := hook.(stopper.Stopper)
|
||||
stoppable, ok := hook.(stop.Stopper)
|
||||
if ok {
|
||||
stopGroup.Add(stoppable)
|
||||
}
|
||||
}
|
||||
|
||||
for _, hook := range l.postHooks {
|
||||
stoppable, ok := hook.(stopper.Stopper)
|
||||
stoppable, ok := hook.(stop.Stopper)
|
||||
if ok {
|
||||
stopGroup.Add(stoppable)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user