Skip to content

Commit

Permalink
Lint 2
Browse files Browse the repository at this point in the history
  • Loading branch information
tmathern committed Nov 28, 2023
1 parent 9a989ba commit 678224a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
35 changes: 17 additions & 18 deletions lib/shellscript-worker-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,26 @@

const { Transformer } = require("@adobe/asset-compute-pipeline");
const ShellScriptWorker = require('./shell/shellscript');
const fs = require('fs-extra');

class ShellscriptCallbackTransformer extends Transformer {
/**
* Construct a transformer for shellscript workers
* @param {*} callback
* @param {*} manifest worker manifest (only one, not a list)
*/
constructor(callback, manifest, params) {
super(`shellscript-workerCallback-${manifest.name}`, manifest);
this._params = params;
this._callback = callback;
}
/**
* Construct a transformer for shellscript workers
* @param {*} callback
* @param {*} manifest worker manifest (only one, not a list)
*/
constructor(callback, manifest, params) {
super(`shellscript-workerCallback-${manifest.name}`, manifest);
this._params = params;
this._callback = callback;
}

async compute(input, output) {
const executionOptions = {
script: this._callback
};
const shellscriptWorker = new ShellScriptWorker(this._params, executionOptions);
return shellscriptWorker.processWithScript(input, output, executionOptions);
}
async compute(input, output) {
const executionOptions = {
script: this._callback
};
const shellscriptWorker = new ShellScriptWorker(this._params, executionOptions);
return shellscriptWorker.processWithScript(input, output, executionOptions);
}
}

module.exports = ShellscriptCallbackTransformer;
6 changes: 3 additions & 3 deletions lib/worker-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ class AssetComputeWorkerPipeline {

let transformer;
if (this.options.hasShellscriptWorker === true) {
debug("Creating a shellscript worker");
// renditionCallback is the script in this case
transformer = new ShellscriptCallbackTransformer(renditionCallback, this.options.manifest, this.options.params);
debug("Creating a shellscript worker");
// renditionCallback is the script in this case
transformer = new ShellscriptCallbackTransformer(renditionCallback, this.options.manifest, this.options.params);
} else if (this.options.hasBatchModeWorker === true) {
debug("Creating a batch worker");
transformer = new BatchWorkerCallbackTransformer(renditionCallback, this.options.manifest);
Expand Down

0 comments on commit 678224a

Please sign in to comment.