Skip to content

Commit

Permalink
added wait between jobs param
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Sep 10, 2024
1 parent 3a39217 commit 9a6964d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/nexrender-worker/src/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const args = arg({
'--tolerate-empty-queues': Number,
'--stop-at-time': String,
'--stop-days': String,
'--wait-between-jobs': Number,

'--skip-cleanup': Boolean,
'--skip-render': Boolean,
Expand Down Expand Up @@ -126,15 +127,15 @@ if (args['--help']) {
--tolerate-empty-queues worker will check an empty queue this many times before exiting (if that option has
been set using --exit-on-empty-queues). Defaults to zero. If specified will be used instead of
NEXRENDER_TOLERATE_EMPTY_QUEUES env variable
--stop-at-time worker will exit at the given time if given.
example: 5:00 will stop at 5 am local time.
example: 5:00 will stop at 5 am local time.
--stop-days comma separated list of weekdays when to stop. Must be used together with --stop-at-time
0 is sunday, 6 is saturday
example: --stop-at-time=5:00 stop-days=1,2,3,4,5
will stop at 5 am but not on weekend
will stop at 5 am but not on weekend
--no-license prevents creation of the ae_render_only_node.txt file (enabled by default),
which allows free usage of trial version of Adobe After Effects
Expand All @@ -152,6 +153,8 @@ if (args['--help']) {
--polling amount of miliseconds to wait before checking queued projects from the api,
if specified will be used instead of NEXRENDER_API_POLLING env variable
--wait-between-jobs amount of miliseconds to wait before checking queued projects from the api
--header Define custom header that the worker will use to communicate with nexrender-server.
Accepted format follows curl or wget request header definition,
eg. --header="Some-Custom-Header: myCustomValue".
Expand All @@ -178,8 +181,8 @@ if (args['--help']) {
--aerender-parameter, --ae forward parameter to aerender (see Adobe site). Parameters with arguments have to be
enclosed in single quotes. For example:
nexrender --aerender-parameter 'close SAVE_CHANGES' --ae 'i 10' job.json
--language language of local after effects installation. currently only en and de are supported
--language language of local after effects installation. currently only en and de are supported
{bold ENV VARS}
Expand Down Expand Up @@ -234,6 +237,7 @@ opt('tolerateEmptyQueues', '--tolerate-empty-queues');
opt('exitOnEmptyQueue', '--exit-on-empty-queue');
opt('stopAtTime', '--stop-at-time');
opt('stopDays', '--stop-days');
opt('waitBetweenJobs', '--wait-between-jobs');
opt('maxMemoryPercent', '--max-memory-percent');
opt('imageCachePercent', '--image-cache-percent');
opt('polling', '--polling');
Expand Down
4 changes: 4 additions & 0 deletions packages/nexrender-worker/src/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ const createWorker = () => {
console.log(`[${job.uid}] continue listening next job...`)
}
}

if (settings.waitBetweenJobs) {
await delay(settings.waitBetweenJobs);
}
} while (active)
}

Expand Down

0 comments on commit 9a6964d

Please sign in to comment.