MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / applyInboundNode

Method applyInboundNode

internal/serverapi/inbounds.go:277–285  ·  view source on GitHub ↗

applyInboundNode 在后台异步将指定节点的最新配置下发到节点(inbound 变更后调用)。

(nodeID string)

Source from the content-addressed store, hash-verified

275
276// applyInboundNode 在后台异步将指定节点的最新配置下发到节点(inbound 变更后调用)。
277func (a *inboundAPI) applyInboundNode(nodeID string) {
278 go func() {
279 ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
280 defer cancel()
281 if err := jobs.ApplyNode(ctx, nodeID, a.nodeStore, a.userStore, a.store, a.outboundStore, a.dial, a.applyOpts); err != nil {
282 log.Printf("warn: apply node %s after inbound change: %v", nodeID, err)
283 }
284 }()
285}
286
287func writeInboundError(w http.ResponseWriter, err error) {
288 status := http.StatusInternalServerError

Callers 3

handleInboundsMethod · 0.95
handleInboundRoutesMethod · 0.95
handleInboundUsersMethod · 0.95

Calls 1

ApplyNodeFunction · 0.92

Tested by

no test coverage detected