mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-25 02:32:52 -05:00
* fix(deps): update all non-major linting dependencies * fix lint issues * chore: increase timeout * chore: increase timeout Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Juan Picado <juanpicado19@gmail.com>
26 lines
698 B
TypeScript
26 lines
698 B
TypeScript
import { $ResponseExtend, $RequestExtend, $NextFunctionVer } from '../../../types';
|
|
import _ from 'lodash';
|
|
import { Application } from 'express';
|
|
|
|
export default (app: Application, selfPath: string): void => {
|
|
// Hook for tests only
|
|
app.get(
|
|
'/-/_debug',
|
|
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
|
|
const doGarbabeCollector = _.isNil(global.gc) === false;
|
|
|
|
if (doGarbabeCollector) {
|
|
global.gc();
|
|
}
|
|
|
|
next({
|
|
pid: process.pid,
|
|
// @ts-ignore
|
|
main: process.mainModule.filename,
|
|
conf: selfPath,
|
|
mem: process.memoryUsage(),
|
|
gc: doGarbabeCollector
|
|
});
|
|
}
|
|
);
|
|
};
|