Skip to content

Commit

Permalink
minor fixes (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Nov 1, 2024
1 parent 0fc1857 commit a7e1c45
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions canary/publicHttpLooper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func NewPublicHttpLooper(id uint, frontend string, opt *LooperOptions, root env_
return &PublicHttpLooper{
id: id,
frontend: frontend,
opt: opt,
root: root,
done: make(chan struct{}),
results: &LooperResults{},
Expand All @@ -40,8 +41,14 @@ func NewPublicHttpLooper(id uint, frontend string, opt *LooperOptions, root env_

func (l *PublicHttpLooper) Run() {
defer close(l.done)
defer logrus.Infof("stopping #%d", l.id)
logrus.Infof("starting #%d", l.id)
defer logrus.Infof("#%d stopping", l.id)
defer func() {
if r := recover(); r != nil {
logrus.Errorf("#%d: %v", l.id, r)
panic(r)
}
}()
logrus.Infof("#%d starting", l.id)

if err := l.startup(); err != nil {
logrus.Fatalf("#%d error starting: %v", l.id, err)
Expand All @@ -53,9 +60,12 @@ func (l *PublicHttpLooper) Run() {

l.dwell()

logrus.Infof("completed #%d", l.id)
l.iterate()

logrus.Infof("#%d completed", l.id)

if err := l.shutdown(); err != nil {
logrus.Fatalf("error shutting down #%d: %v", l.id, err)
logrus.Fatalf("#%d: error shutting down: %v", l.id, err)
}
}

Expand Down Expand Up @@ -83,7 +93,7 @@ func (l *PublicHttpLooper) startup() error {
return err
}
l.shr = shr
logrus.Infof("#%d allocated share '%v'", l.id, l.shr)
logrus.Infof("#%d allocated share '%v'", l.id, l.shr.Token)

return nil
}
Expand Down

0 comments on commit a7e1c45

Please sign in to comment.