This commit is contained in:
Matt Mason 2017-09-24 16:29:21 -07:00 коммит произвёл mamaso
Родитель 3ad2fb243d
Коммит 4ed4d620fd
3 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -5,7 +5,8 @@
"google-protobuf": "^3.0.0",
"grpc": "^1.6.0",
"minimist": "^1.2.0",
"protobufjs": "6.7.0"
"protobufjs": "6.7.0",
"semver": "^5.4.1"
},
"devDependencies": {
"@types/mocha": "^2.2.41",

Просмотреть файл

@ -1,4 +1,5 @@
import * as parseArgs from 'minimist';
import * as semver from 'semver';
import { FunctionRpc as rpc } from '../protos/rpc';
import Status = rpc.StatusResult.Status;
@ -13,6 +14,12 @@ export function startNodeWorker(args) {
throw new Error('Connection info missing');
}
if (!semver.satisfies(process.version, '>=8.4.0')) {
console.error(`azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version ${process.version}.
To install required native modules for ${process.version}, install node-pre-gyp via 'npm i -g node-pre-gyp'.
Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'`);
}
let connection = `${host}:${port}`;
console.log(`Worker ${workerId} connecting on ${connection}`);
let eventStream = CreateGrpcEventStream(connection);

Просмотреть файл

@ -1,3 +1,9 @@
var worker = require("../../worker-bundle.js")
var worker;
try {
worker = require("../../worker-bundle.js");
} catch (err) {
console.error(`Couldn't require bundle, falling back to Worker.js. ${err}`);
worker = require("./Worker.js");
}
worker.startNodeWorker(process.argv);