mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 17:58:46 +00:00
Add hook to init and listen observatory statuses
This commit is contained in:
@@ -32,6 +32,8 @@ type Observer struct {
|
||||
finished *done.Instance
|
||||
|
||||
ohm outbound.Manager
|
||||
|
||||
StatusUpdate func(result *OutboundStatus)
|
||||
}
|
||||
|
||||
func (o *Observer) GetObservation(ctx context.Context) (proto.Message, error) {
|
||||
@@ -183,6 +185,10 @@ func (o *Observer) updateStatusForResult(outbound string, result *ProbeResult) {
|
||||
status.LastErrorReason = result.LastErrorReason
|
||||
status.Delay = 99999999
|
||||
}
|
||||
|
||||
if o.StatusUpdate != nil {
|
||||
o.StatusUpdate(status)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Observer) findStatusLocationLockHolderOnly(outbound string) int {
|
||||
|
||||
Reference in New Issue
Block a user