mirror of
https://github.com/lkmio/lkm.git
synced 2025-10-05 23:26:51 +08:00
打印http hook响应
This commit is contained in:
@@ -20,7 +20,6 @@ func PreparePublishSource(source Source, hook bool) (*http.Response, utils.HookS
|
||||
}
|
||||
|
||||
if err := SourceManager.Add(source); err != nil {
|
||||
log.Sugar.Errorf("添加源失败 source:%s err:%s", source.Id(), err.Error())
|
||||
return nil, utils.HookStateOccupy
|
||||
}
|
||||
|
||||
@@ -45,7 +44,6 @@ func HookPublishEvent(source Source) (*http.Response, utils.HookState) {
|
||||
if AppConfig.Hook.IsEnablePublishEvent() {
|
||||
hook, err := Hook(HookEventPublish, source.UrlValues().Encode(), NewHookPublishEventInfo(source))
|
||||
if err != nil {
|
||||
log.Sugar.Errorf("通知推流事件失败 source:%s err:%s", source.Id(), err.Error())
|
||||
return hook, utils.HookStateFailure
|
||||
}
|
||||
|
||||
@@ -57,10 +55,7 @@ func HookPublishEvent(source Source) (*http.Response, utils.HookState) {
|
||||
|
||||
func HookPublishDoneEvent(source Source) {
|
||||
if AppConfig.Hook.IsEnablePublishEvent() {
|
||||
_, err := Hook(HookEventPublishDone, source.UrlValues().Encode(), NewHookPublishEventInfo(source))
|
||||
if err != nil {
|
||||
log.Sugar.Errorf("通知推流结束事件失败 source:%s err:%s", source.Id(), err.Error())
|
||||
}
|
||||
_, _ = Hook(HookEventPublishDone, source.UrlValues().Encode(), NewHookPublishEventInfo(source))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +65,6 @@ func HookReceiveTimeoutEvent(source Source) (*http.Response, utils.HookState) {
|
||||
if AppConfig.Hook.IsEnableOnReceiveTimeout() {
|
||||
resp, err := Hook(HookEventReceiveTimeout, source.UrlValues().Encode(), NewHookPublishEventInfo(source))
|
||||
if err != nil {
|
||||
log.Sugar.Errorf("通知收流超时事件失败 source:%s err:%s", source.Id(), err.Error())
|
||||
return resp, utils.HookStateFailure
|
||||
}
|
||||
|
||||
@@ -86,7 +80,6 @@ func HookIdleTimeoutEvent(source Source) (*http.Response, utils.HookState) {
|
||||
if AppConfig.Hook.IsEnableOnIdleTimeout() {
|
||||
resp, err := Hook(HookEventIdleTimeout, source.UrlValues().Encode(), NewHookPublishEventInfo(source))
|
||||
if err != nil {
|
||||
log.Sugar.Errorf("通知空闲超时时间失败 source:%s err:%s", source.Id(), err.Error())
|
||||
return resp, utils.HookStateFailure
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user