This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree 6 files changed +63
-25
lines changed
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 14
14
},
15
15
"dependencies" : {
16
16
"actionhero" : " 8.0.x" ,
17
- "xml2js" : " 0.2.x" ,
17
+ "adm-zip" : " 0.4.x" ,
18
+ "archiver" : " ~0.6.1" ,
19
+ "asn1" : " *" ,
18
20
"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" ,
25
21
"bcrypt" : " 0.7.x" ,
26
22
"bigdecimal" : " 0.6.x" ,
27
23
"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" : " *" ,
32
24
"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" ,
33
32
"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" ,
38
34
"mime" : " ~1.2.11" ,
39
- "xtend" : " 2.1.x" ,
40
- "validator" : " ~3.5.0" ,
41
- "adm-zip" : " 0.4.x" ,
42
35
"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" ,
44
39
"redis" : " 0.10.x" ,
45
- "temp" : " 0.7.0" ,
40
+ "request" : " ~2.33.0" ,
41
+ "soap" : " ~0.3.2" ,
46
42
"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"
49
50
},
50
51
"devDependencies" : {
51
52
"supertest" : " 0.8.x" ,
52
53
"mocha" : " 1.x" ,
53
54
"chai" : " 1.8.x" ,
54
55
"fakeredis" : " 0.1.x" ,
55
56
"should" : " >= 3.0.0"
56
- },
57
+ },
57
58
"scripts" : {
58
59
"start" : " node ./node_modules/.bin/actionhero start &" ,
59
60
"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 = {
406
406
{ path : "/:apiVersion/data/srm/rounds/:roundId/components" , action : "setRoundComponents" } ,
407
407
{ path : "/:apiVersion/data/srm/rounds/:roundId/terms" , action : "setRoundTerms" } ,
408
408
{ 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" }
410
411
] ,
411
412
put : [
412
413
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
3
3
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
+
5
8
forever start -d -v -a -l " ${DIR} /log/forever.log" " ${DIR} /node_modules/actionhero/bin/actionhero" start
6
9
# 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