@nexrender/worker 1.43.3 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/readme.md +1 -0
- package/src/bin.js +12 -0
- package/src/index.js +17 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexrender/worker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.0",
|
|
4
4
|
"author": "inlife",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@nexrender/api": "^1.43.1",
|
|
20
|
-
"@nexrender/core": "^1.
|
|
20
|
+
"@nexrender/core": "^1.44.0",
|
|
21
21
|
"@nexrender/types": "^1.43.1",
|
|
22
22
|
"arg": "^4.1.0",
|
|
23
23
|
"chalk": "^2.4.2",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "10534b5ae73c920a6ea3c5cc7c3d6ac542112319"
|
|
30
30
|
}
|
package/readme.md
CHANGED
|
@@ -88,6 +88,7 @@ Available settings (almost same as for `nexrender-core`):
|
|
|
88
88
|
* `tagSelector` - string, (optional) provide the string tags (example `primary,plugins,halowell` : comma delimited) to pickup the job with specific tags. Leave it false to ignore and pick a random job from the server with no specific tags. Tags name must be an alphanumeric.
|
|
89
89
|
* `wslMap` - string, drive letter of your WSL mapping in Windows
|
|
90
90
|
* `aeParams` - array of strings, any additional params that will be passed to the aerender binary, a name-value parameter pair separated by a space,
|
|
91
|
+
* `noAnalytics` - boolean, enables or disables built-in fully-anonymous analytics, false by default
|
|
91
92
|
* `actions` - an object with keys corresponding to the `module` field when defining an action, value should be a function matching expected signature of an action. Used for defining actions programmatically without needing to package the action as a separate package
|
|
92
93
|
* `cache` - boolean or string. Set the cache folder used by HTTP assets. If `true` will use the default path of `${workpath}/http-cache`, if set to a string it will be interpreted as a filesystem path to the cache folder.
|
|
93
94
|
|
package/src/bin.js
CHANGED
|
@@ -30,6 +30,7 @@ const args = arg({
|
|
|
30
30
|
'--skip-cleanup': Boolean,
|
|
31
31
|
'--skip-render': Boolean,
|
|
32
32
|
'--no-license': Boolean,
|
|
33
|
+
'--no-analytics': Boolean,
|
|
33
34
|
'--force-patch': Boolean,
|
|
34
35
|
'--debug': Boolean,
|
|
35
36
|
'--multi-frames': Boolean,
|
|
@@ -120,6 +121,9 @@ if (args['--help']) {
|
|
|
120
121
|
--no-license prevents creation of the ae_render_only_node.txt file (enabled by default),
|
|
121
122
|
which allows free usage of trial version of Adobe After Effects
|
|
122
123
|
|
|
124
|
+
--no-analytics prevents collection of fully anonymous analytics by nexrender (enabled by default),
|
|
125
|
+
this data is used to improve nexrender and its features, read on what is collected in the readme
|
|
126
|
+
|
|
123
127
|
--force-patch forces commandLineRenderer.jsx patch (re)installation
|
|
124
128
|
|
|
125
129
|
--debug enables command dump for aerender, and other debugging stuff
|
|
@@ -198,6 +202,7 @@ if (settings.hasOwnProperty('ae-params')) {
|
|
|
198
202
|
opt('binary', '--binary');
|
|
199
203
|
opt('workpath', '--workpath');
|
|
200
204
|
opt('no-license', '--no-license');
|
|
205
|
+
opt('no-analytics', '--no-analytics');
|
|
201
206
|
opt('skipCleanup', '--skip-cleanup');
|
|
202
207
|
opt('skipRender', '--skip-render');
|
|
203
208
|
opt('forceCommandLinePatch','--force-patch');
|
|
@@ -247,6 +252,13 @@ if (settings['no-license']) {
|
|
|
247
252
|
settings.addLicense = true;
|
|
248
253
|
}
|
|
249
254
|
|
|
255
|
+
if (settings['no-analytics']) {
|
|
256
|
+
settings.noAnalytics = true;
|
|
257
|
+
delete settings['no-analytics'];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
settings['process'] = 'nexrender-worker-cli';
|
|
261
|
+
|
|
250
262
|
const headers = {};
|
|
251
263
|
if (args['--header']){
|
|
252
264
|
args['--header'].forEach((header) => {
|
package/src/index.js
CHANGED
|
@@ -53,7 +53,7 @@ const nextJob = async (client, settings) => {
|
|
|
53
53
|
* @return {Promise}
|
|
54
54
|
*/
|
|
55
55
|
const start = async (host, secret, settings, headers) => {
|
|
56
|
-
settings = init(Object.assign({}, settings, {
|
|
56
|
+
settings = init(Object.assign({ process: 'nexrender-worker' }, settings, {
|
|
57
57
|
logger: console,
|
|
58
58
|
}))
|
|
59
59
|
|
|
@@ -73,12 +73,24 @@ const start = async (host, secret, settings, headers) => {
|
|
|
73
73
|
|
|
74
74
|
const client = createClient({ host, secret, headers });
|
|
75
75
|
|
|
76
|
+
settings.track('Worker Started', {
|
|
77
|
+
worker_tags_set: !!settings.tagSelector,
|
|
78
|
+
worker_setting_tolerate_empty_queues: settings.tolerateEmptyQueues,
|
|
79
|
+
worker_setting_exit_on_empty_queue: settings.exitOnEmptyQueue,
|
|
80
|
+
worker_setting_polling: settings.polling,
|
|
81
|
+
worker_setting_stop_on_error: settings.stopOnError,
|
|
82
|
+
})
|
|
83
|
+
|
|
76
84
|
do {
|
|
77
85
|
let job = await nextJob(client, settings);
|
|
78
86
|
|
|
79
87
|
// if the worker has been deactivated, exit this loop
|
|
80
88
|
if (!active) break;
|
|
81
89
|
|
|
90
|
+
settings.track('Worker Job Started', {
|
|
91
|
+
job_id: job.uid, // anonymized internally
|
|
92
|
+
})
|
|
93
|
+
|
|
82
94
|
job.state = 'started';
|
|
83
95
|
job.startedAt = new Date()
|
|
84
96
|
|
|
@@ -115,12 +127,16 @@ const start = async (host, secret, settings, headers) => {
|
|
|
115
127
|
job.finishedAt = new Date()
|
|
116
128
|
}
|
|
117
129
|
|
|
130
|
+
settings.track('Worker Job Finished', { job_id: job.uid })
|
|
131
|
+
|
|
118
132
|
await client.updateJob(job.uid, getRenderingStatus(job))
|
|
119
133
|
} catch (err) {
|
|
120
134
|
job.error = [].concat(job.error || [], [err.toString()]);
|
|
121
135
|
job.errorAt = new Date();
|
|
122
136
|
job.state = 'error';
|
|
123
137
|
|
|
138
|
+
settings.track('Worker Job Error', { job_id: job.uid })
|
|
139
|
+
|
|
124
140
|
await client.updateJob(job.uid, getRenderingStatus(job)).catch((err) => {
|
|
125
141
|
if (settings.stopOnError) {
|
|
126
142
|
throw err;
|