Browse Source

remove /dump/heap endpoint and dependency on heapdump package

umbrel
kenshin-samourai 6 years ago
parent
commit
e0a98f0dfe
  1. 29
      accounts/support-rest-api.js
  2. 5
      package-lock.json
  3. 1
      package.json

29
accounts/support-rest-api.js

@ -4,7 +4,6 @@
*/ */
'use strict' 'use strict'
const heapdump = require('heapdump')
const validator = require('validator') const validator = require('validator')
const bodyParser = require('body-parser') const bodyParser = require('body-parser')
const errors = require('../lib/errors') const errors = require('../lib/errors')
@ -69,13 +68,6 @@ class SupportRestApi {
HttpServer.sendAuthError HttpServer.sendAuthError
) )
this.httpServer.app.get(
`/${keys.prefixes.support}/dump/heap`,
authMgr.checkHasAdminProfile.bind(authMgr),
this.getHeapDump.bind(this),
HttpServer.sendAuthError
)
this.httpServer.app.get( this.httpServer.app.get(
`/${keys.prefixes.support}/pairing`, `/${keys.prefixes.support}/pairing`,
authMgr.checkHasAdminProfile.bind(authMgr), authMgr.checkHasAdminProfile.bind(authMgr),
@ -283,27 +275,6 @@ class SupportRestApi {
} }
} }
/**
* Get a dump of the heap
* and store it on the filesystem
*/
async getHeapDump(req, res) {
try {
heapdump.writeSnapshot(function(err, filename) {
Logger.info(`Dump written to ${filename}`)
})
HttpServer.sendOk(res)
} catch(e) {
const ret = {
status: 'error'
}
Logger.error(e, 'SupportRestApi.getHeapDump() : Support head dump error')
HttpServer.sendError(res, JSON.stringify(ret, null, 2))
} finally {
debugApi && Logger.info(`Completed GET /dump/heap`)
}
}
/** /**
* Get pairing info * Get pairing info
*/ */

5
package-lock.json

@ -1012,11 +1012,6 @@
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true "dev": true
}, },
"heapdump": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/heapdump/-/heapdump-0.3.9.tgz",
"integrity": "sha1-A8dOsN9dZ74Jgug0KbqcnSs7f3g="
},
"helmet": { "helmet": {
"version": "3.12.1", "version": "3.12.1",
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.12.1.tgz", "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.12.1.tgz",

1
package.json

@ -23,7 +23,6 @@
"express": "4.16.3", "express": "4.16.3",
"express-jwt": "5.3.1", "express-jwt": "5.3.1",
"generic-pool": "3.4.2", "generic-pool": "3.4.2",
"heapdump": "0.3.9",
"helmet": "3.12.1", "helmet": "3.12.1",
"lodash": "4.17.14", "lodash": "4.17.14",
"lru-cache": "4.0.2", "lru-cache": "4.0.2",

Loading…
Cancel
Save