This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +63
-25
lines changed Expand file tree Collapse file tree 6 files changed +63
-25
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2014 TopCoder Inc., All Rights Reserved.
3+ */
4+ "use strict" ;
5+ var heapdump = require ( 'heapdump' ) ;
6+
7+ exports . dumpMemory = {
8+ name : 'dumpMemory' ,
9+ description : 'dump memory' ,
10+ inputs : {
11+ required : [ ] ,
12+ optional : [ ]
13+ } ,
14+ version : 'v2' ,
15+ run : function ( api , connection , next ) {
16+ if ( process . env . ADMIN_API_KEY && connection . params . apiKey === process . env . ADMIN_API_KEY ) {
17+ heapdump . writeSnapshot ( function ( err , filename ) {
18+ if ( err ) {
19+ connection . result = 'error: ' + err ;
20+ }
21+ else {
22+ connection . result = 'dump written to: ' + filename ;
23+ }
24+ next ( connection , true ) ;
25+ } ) ;
26+ } else {
27+ next ( connection , true ) ;
28+ }
29+ }
30+ } ;
Original file line number Diff line number Diff line change 1414 },
1515 "dependencies" : {
1616 "actionhero" : " 8.0.x" ,
17- "xml2js" : " 0.2.x" ,
17+ "adm-zip" : " 0.4.x" ,
18+ "archiver" : " ~0.6.1" ,
19+ "asn1" : " *" ,
1820 "async" : " 0.2.x" ,
19- "underscore" : " 1.5.x" ,
20- "datejs" : " 0.0.x" ,
21- "string" : " 1.6.x" ,
22- "ldapjs" : " 0.7.x" ,
23- "nodemailer" : " 0.5.x" ,
24- "email-templates" : " 0.1.x" ,
2521 "bcrypt" : " 0.7.x" ,
2622 "bigdecimal" : " 0.6.x" ,
2723 "bignum" : " 0.6.x" ,
28- "java" : " 0.3.x" ,
29- "informix-wrapper" : " git://github.com/cloudspokes/informix-wrapper.git#46d1c91c3a8e164f888e88627b8da712e9ceb855" ,
30- "forums-wrapper" : " git://github.com/cloudspokes/forums-wrapper.git#12b57be495c2e10431173522bc9eff60e0575959" ,
31- "asn1" : " *" ,
3224 "crypto" : " 0.0.x" ,
25+ "datejs" : " 0.0.x" ,
26+ "email-templates" : " 0.1.x" ,
27+ "forums-wrapper" : " git://github.com/cloudspokes/forums-wrapper.git#12b57be495c2e10431173522bc9eff60e0575959" ,
28+ "heapdump" : " ^0.3.6" ,
29+ "highlight.js" : " >= 8.3.0" ,
30+ "informix-wrapper" : " git://github.com/cloudspokes/informix-wrapper.git#46d1c91c3a8e164f888e88627b8da712e9ceb855" ,
31+ "java" : " 0.3.x" ,
3332 "jsonwebtoken" : " 0.4.x" ,
34- "request" : " ~2.33.0" ,
35- "soap" : " ~0.3.2" ,
36- "moment-timezone" : " 0.0.x" ,
37- "moment" : " ~2.5.1" ,
33+ "ldapjs" : " 0.7.x" ,
3834 "mime" : " ~1.2.11" ,
39- "xtend" : " 2.1.x" ,
40- "validator" : " ~3.5.0" ,
41- "adm-zip" : " 0.4.x" ,
4235 "mkdirp" : " 0.3.x" ,
43- "archiver" : " ~0.6.1" ,
36+ "moment" : " ~2.5.1" ,
37+ "moment-timezone" : " 0.0.x" ,
38+ "nodemailer" : " 0.5.x" ,
4439 "redis" : " 0.10.x" ,
45- "temp" : " 0.7.0" ,
40+ "request" : " ~2.33.0" ,
41+ "soap" : " ~0.3.2" ,
4642 "ssha" : " *" ,
47- "highlight.js" : " >= 8.3.0" ,
48- "wkhtmltoimage" : " >= 0.1.3"
43+ "string" : " 1.6.x" ,
44+ "temp" : " 0.7.0" ,
45+ "underscore" : " 1.5.x" ,
46+ "validator" : " ~3.5.0" ,
47+ "wkhtmltoimage" : " >= 0.1.3" ,
48+ "xml2js" : " 0.2.x" ,
49+ "xtend" : " 2.1.x"
4950 },
5051 "devDependencies" : {
5152 "supertest" : " 0.8.x" ,
5253 "mocha" : " 1.x" ,
5354 "chai" : " 1.8.x" ,
5455 "fakeredis" : " 0.1.x" ,
5556 "should" : " >= 3.0.0"
56- },
57+ },
5758 "scripts" : {
5859 "start" : " node ./node_modules/.bin/actionhero start &" ,
5960 "test" : " node_modules/.bin/mocha --recursive ./test" ,
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ ./stop.sh && ./start.sh
Original file line number Diff line number Diff line change @@ -406,7 +406,8 @@ exports.routes = {
406406 { path : "/:apiVersion/data/srm/rounds/:roundId/components" , action : "setRoundComponents" } ,
407407 { path : "/:apiVersion/data/srm/rounds/:roundId/terms" , action : "setRoundTerms" } ,
408408 { path : "/:apiVersion/data/srm/rounds" , action : "createSRMContestRound" } ,
409- { path : "/:apiVersion/src2image" , action : "convertSourceCodeToImage" }
409+ { path : "/:apiVersion/src2image" , action : "convertSourceCodeToImage" } ,
410+ { path : "/:apiVersion/dump" , action : "dumpMemory" }
410411 ] ,
411412 put : [
412413
Original file line number Diff line number Diff line change 11#! /bin/bash
22DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
33
4- # nohup node ~/tc-api/node_modules/.bin/actionHero start 2>&1 &
4+ if [ -a deploy/env.sh ]; then
5+ . deploy/env.sh
6+ fi
7+
58forever start -d -v -a -l " ${DIR} /log/forever.log" " ${DIR} /node_modules/actionhero/bin/actionhero" start
69# forever start -d -a -l "${DIR}/log/forever.log" "${DIR}/node_modules/actionhero/bin/actionhero" startCluster --workers=10
You can’t perform that action at this time.
0 commit comments