Skip to content

Commit

Permalink
Fix: keep probeInterval consistent for the same outbound (#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
digglife committed Aug 25, 2021
1 parent 4f9415d commit 67cd3ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/observatory/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"net/url"
"sort"
"sync"
"time"

Expand Down Expand Up @@ -68,6 +69,7 @@ func (o *Observer) background() {
}

outbounds := hs.Select(o.config.SubjectSelector)
sort.Strings(outbounds)

o.updateStatus(outbounds)

Expand Down Expand Up @@ -111,7 +113,7 @@ func (o *Observer) probe(outbound string) ProbeResult {
trackedCtx := session.TrackedConnectionError(o.ctx, errorCollectorForRequest)
conn, err := tagged.Dialer(trackedCtx, dest, outbound)
if err != nil {
return newError("cannot dial remote address", dest).Base(err)
return newError("cannot dial remote address ", dest).Base(err)
}
connection = conn
return nil
Expand Down Expand Up @@ -158,7 +160,7 @@ func (o *Observer) probe(outbound string) ProbeResult {
fullerr.WriteToLog()
return ProbeResult{Alive: false, LastErrorReason: fullerr.Error()}
}
newError("the outbound ", outbound, "is alive:", GETTime.Seconds()).AtInfo().WriteToLog()
newError("the outbound ", outbound, " is alive:", GETTime.Seconds()).AtInfo().WriteToLog()
return ProbeResult{Alive: true, Delay: GETTime.Milliseconds()}
}

Expand Down

0 comments on commit 67cd3ac

Please sign in to comment.