Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit b3e5c97

Browse files
committed
Merge pull request #451 from appirio-tech/release
Release
2 parents 6e7311e + 424ef88 commit b3e5c97

File tree

6 files changed

+63
-25
lines changed

6 files changed

+63
-25
lines changed

actions/memDump.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
};

package.json

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,47 @@
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",

restart.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
./stop.sh && ./start.sh

routes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

start.sh

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
DIR="$( 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+
58
forever 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

stop.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)