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

Release #451

Merged
merged 7 commits into from
Jul 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions actions/memDump.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2014 TopCoder Inc., All Rights Reserved.
*/
"use strict";
var heapdump = require('heapdump');

exports.dumpMemory = {
name: 'dumpMemory',
description: 'dump memory',
inputs: {
required: [],
optional: []
},
version: 'v2',
run: function (api, connection, next) {
if (process.env.ADMIN_API_KEY && connection.params.apiKey === process.env.ADMIN_API_KEY) {
heapdump.writeSnapshot(function(err, filename) {
if (err) {
connection.result = 'error: ' + err;
}
else {
connection.result = 'dump written to: ' + filename;
}
next(connection, true);
});
} else {
next(connection, true);
}
}
};
47 changes: 24 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,47 @@
},
"dependencies": {
"actionhero": "8.0.x",
"xml2js": "0.2.x",
"adm-zip": "0.4.x",
"archiver": "~0.6.1",
"asn1": "*",
"async": "0.2.x",
"underscore": "1.5.x",
"datejs": "0.0.x",
"string": "1.6.x",
"ldapjs": "0.7.x",
"nodemailer": "0.5.x",
"email-templates": "0.1.x",
"bcrypt": "0.7.x",
"bigdecimal": "0.6.x",
"bignum": "0.6.x",
"java": "0.3.x",
"informix-wrapper": "git://github.com/cloudspokes/informix-wrapper.git#46d1c91c3a8e164f888e88627b8da712e9ceb855",
"forums-wrapper": "git://github.com/cloudspokes/forums-wrapper.git#12b57be495c2e10431173522bc9eff60e0575959",
"asn1": "*",
"crypto": "0.0.x",
"datejs": "0.0.x",
"email-templates": "0.1.x",
"forums-wrapper": "git://github.com/cloudspokes/forums-wrapper.git#12b57be495c2e10431173522bc9eff60e0575959",
"heapdump": "^0.3.6",
"highlight.js": ">= 8.3.0",
"informix-wrapper": "git://github.com/cloudspokes/informix-wrapper.git#46d1c91c3a8e164f888e88627b8da712e9ceb855",
"java": "0.3.x",
"jsonwebtoken": "0.4.x",
"request": "~2.33.0",
"soap": "~0.3.2",
"moment-timezone": "0.0.x",
"moment": "~2.5.1",
"ldapjs": "0.7.x",
"mime": "~1.2.11",
"xtend": "2.1.x",
"validator": "~3.5.0",
"adm-zip": "0.4.x",
"mkdirp": "0.3.x",
"archiver": "~0.6.1",
"moment": "~2.5.1",
"moment-timezone": "0.0.x",
"nodemailer": "0.5.x",
"redis": "0.10.x",
"temp": "0.7.0",
"request": "~2.33.0",
"soap": "~0.3.2",
"ssha": "*",
"highlight.js": ">= 8.3.0",
"wkhtmltoimage": ">= 0.1.3"
"string": "1.6.x",
"temp": "0.7.0",
"underscore": "1.5.x",
"validator": "~3.5.0",
"wkhtmltoimage": ">= 0.1.3",
"xml2js": "0.2.x",
"xtend": "2.1.x"
},
"devDependencies": {
"supertest": "0.8.x",
"mocha": "1.x",
"chai": "1.8.x",
"fakeredis": "0.1.x",
"should": ">= 3.0.0"
},
},
"scripts": {
"start": "node ./node_modules/.bin/actionhero start &",
"test": "node_modules/.bin/mocha --recursive ./test",
Expand Down
3 changes: 3 additions & 0 deletions restart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

./stop.sh && ./start.sh
3 changes: 2 additions & 1 deletion routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ exports.routes = {
{ path: "/:apiVersion/data/srm/rounds/:roundId/components", action: "setRoundComponents"},
{ path: "/:apiVersion/data/srm/rounds/:roundId/terms", action: "setRoundTerms"},
{ path: "/:apiVersion/data/srm/rounds", action: "createSRMContestRound" },
{ path: "/:apiVersion/src2image", action: "convertSourceCodeToImage" }
{ path: "/:apiVersion/src2image", action: "convertSourceCodeToImage" },
{ path: "/:apiVersion/dump", action: "dumpMemory"}
],
put: [

Expand Down
5 changes: 4 additions & 1 deletion start.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# nohup node ~/tc-api/node_modules/.bin/actionHero start 2>&1 &
if [ -a deploy/env.sh ]; then
. deploy/env.sh
fi

forever start -d -v -a -l "${DIR}/log/forever.log" "${DIR}/node_modules/actionhero/bin/actionhero" start
#forever start -d -a -l "${DIR}/log/forever.log" "${DIR}/node_modules/actionhero/bin/actionhero" startCluster --workers=10
Empty file modified stop.sh
100644 → 100755
Empty file.