MCPcopy
hub / github.com/electerm/electerm / withOperationClient

Method withOperationClient

src/app/server/session-ftp.js:42–52  ·  view source on GitHub ↗
(handler, client)

Source from the content-addressed store, hash-verified

40 }
41
42 async withOperationClient (handler, client) {
43 if (client) {
44 return handler(client)
45 }
46 const operationClient = await this.createOperationClient()
47 try {
48 return await handler(operationClient)
49 } finally {
50 await operationClient.close().catch(() => {})
51 }
52 }
53
54 async connect (initOptions) {
55 this.initOptions = {

Callers 13

getHomeDirMethod · 0.95
rmdirMethod · 0.95
touchMethod · 0.95
mkdirMethod · 0.95
statMethod · 0.95
realpathMethod · 0.95
renameMethod · 0.95
rmFolderMethod · 0.95
rmMethod · 0.95
listMethod · 0.95
readFileMethod · 0.95
writeFileMethod · 0.95

Calls 3

createOperationClientMethod · 0.95
handlerFunction · 0.50
closeMethod · 0.45

Tested by

no test coverage detected