Commit 66a27d36 authored by nilanjandaw's avatar nilanjandaw

dispatch daemon file download bug fixed

parent b5471d2d
......@@ -30,7 +30,7 @@ client.on('message', function (topic, message) {
if (message.type === "execute") {
console.log("function_id", function_id);
if (!fs.existsSync(local_repository + functionHash)) {
libSupport.download(host_url + "repository/" + functionHash, local_repository + functionHash).then(() => {
libSupport.download(host_url + "/repository/" + functionHash, local_repository + functionHash).then(() => {
if (runtime === "isolate")
execute.runIsolate(local_repository + functionHash).then(result => {
......
......@@ -3,6 +3,8 @@ var fs = require('fs');
var download = function (url, dest, cb) {
return new Promise((resolve, reject) => {
console.log(url);
var file = fs.createWriteStream(dest);
var request = http.get(url, function (response) {
response.pipe(file);
......
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