Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const events = context.apis.foundation.getSystemEvents();
const {
slicer_port: slicerPort,
slicer_hostname: slicerHostname,
performance_metrics: performanceMetrics
} = executionContext.config;
const config = context.sysconfig.teraslice;
const networkLatencyBuffer = get(config, 'network_latency_buffer');
const actionTimeout = get(config, 'action_timeout');
const workerDisconnectTimeout = get(config, 'worker_disconnect_timeout');
const slicerTimeout = get(config, 'slicer_timeout');
const shutdownTimeout = get(config, 'shutdown_timeout');
this.client = new ExecutionController.Client({
executionControllerUrl: formatURL(slicerHostname, slicerPort),
workerId,
networkLatencyBuffer,
workerDisconnectTimeout,
// the connect timeout should be set to the same timeout that will
// cause the execution fail if no Workers connect
connectTimeout: slicerTimeout,
actionTimeout,
logger
});
this.slice = new Slice(context, executionContext);
this.metrics = performanceMetrics
? new Metrics({
logger