Permalink
Browse files

Merge pull request #187 from dusty/master

payload can accept a querystring
  • Loading branch information...
2 parents 2247549 + d43f2a2 commit 2ab721eec43a66eb4e418dc0378ef28b9353513f @treeder treeder committed Jul 19, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/iron_worker_ng/code/runtime/node.rb
View
7 lib/iron_worker_ng/code/runtime/node.rb
@@ -10,13 +10,18 @@ def runtime_bundle(container, local = false)
/* #{IronWorkerNG.full_version} */
var fs = require('fs');
+var querystring = require('querystring');
var params = null;
var task_id = null;
var config = null;
process.argv.forEach(function(val, index, array) {
if (val == "-payload") {
- params = JSON.parse(fs.readFileSync(process.argv[index + 1], 'utf8'));
+ try {
+ params = JSON.parse(fs.readFileSync(process.argv[index + 1], 'utf8'));
+ } catch(e) {
+ params = querystring.parse(fs.readFileSync(process.argv[index + 1], 'utf8'))
+ }
}
if (val == "-config") {

0 comments on commit 2ab721e

Please sign in to comment.