MCPcopy
hub / github.com/di-sukharev/opencommit / onFree

Function onFree

out/cli.cjs:9619–9639  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9617 function installListeners(agent, socket, options) {
9618 debug5("%s create, timeout %sms", socket[SOCKET_NAME], getSocketTimeout(socket));
9619 function onFree() {
9620 if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return;
9621 socket[SOCKET_REQUEST_FINISHED_COUNT]++;
9622 agent.requestCount++;
9623 debug5(
9624 "%s(requests: %s, finished: %s) free",
9625 socket[SOCKET_NAME],
9626 socket[SOCKET_REQUEST_COUNT],
9627 socket[SOCKET_REQUEST_FINISHED_COUNT]
9628 );
9629 const name = agent.getName(options);
9630 if (socket.writable && agent.requests[name] && agent.requests[name].length) {
9631 socket[SOCKET_REQUEST_COUNT]++;
9632 debug5(
9633 "%s(requests: %s, finished: %s) will be reuse on agent free event",
9634 socket[SOCKET_NAME],
9635 socket[SOCKET_REQUEST_COUNT],
9636 socket[SOCKET_REQUEST_FINISHED_COUNT]
9637 );
9638 }
9639 }
9640 socket.on("free", onFree);
9641 function onClose(isError2) {
9642 debug5(

Callers

nothing calls this directly

Calls 2

debug5Function · 0.85
getNameMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…