Commit 6a4b137f authored by project's avatar project

--no commit message

--no commit message
parent 54193fcc
...@@ -6,10 +6,16 @@ function execute_function(context,response){ ...@@ -6,10 +6,16 @@ function execute_function(context,response){
var param = context.jobconfig.data_in.param; var param = context.jobconfig.data_in.param;
var memstore = context.task.memstore var memstore = context.task.memstore
var output_type = 'text' var output_type = 'text';
var url = param.url; var url = param.url;
request(url, function (error, resp, body) { var encode = 'utf8';
if(param.encoding == 'binary'){
encode = null;
output_type = 'binary'
}
request({'url':url, 'encoding':null, function (error, resp, body) {
if (!error && resp.statusCode == 200) { if (!error && resp.statusCode == 200) {
response.success(body); response.success(body);
}else{ }else{
......
...@@ -219,15 +219,15 @@ var job_config = { ...@@ -219,15 +219,15 @@ var job_config = {
// }); // });
var client = redis.createClient('redis://lab1.igridproject.info:6379/1'); // var client = redis.createClient('redis://lab1.igridproject.info:6379/1');
//var client = redis.createClient('redis://localhost:9736/1'); // //var client = redis.createClient('redis://localhost:9736/1');
//
client.hgetall('bs:regis:triggers', function (err, rep) { // client.hgetall('bs:regis:triggers', function (err, rep) {
Object.keys(rep).forEach(function(a,b){ // Object.keys(rep).forEach(function(a,b){
console.log(b); // console.log(b);
}) // })
//console.log(Object.keys(rep)); // //console.log(Object.keys(rep));
}); // });
//client.hset('bs:regis:triggers','job01',JSON.stringify(job_config)); //client.hset('bs:regis:triggers','job01',JSON.stringify(job_config));
// var CronList = ctx.getLib('lib/mems/cronlist'); // var CronList = ctx.getLib('lib/mems/cronlist');
...@@ -240,3 +240,9 @@ client.hgetall('bs:regis:triggers', function (err, rep) { ...@@ -240,3 +240,9 @@ client.hgetall('bs:regis:triggers', function (err, rep) {
// crons.update(function(err){ // crons.update(function(err){
// console.log(crons.list); // console.log(crons.list);
// }); // });
var wUrl = "http://203.155.220.231/Radar/pics/zfiltered.jpg";
var request = require('request').defa
request.get(wUrl, function (err, res, body) {
console.log(body);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment