@nexrender/core 1.54.3 → 1.54.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexrender/core",
3
- "version": "1.54.3",
3
+ "version": "1.54.5",
4
4
  "main": "src/index.js",
5
5
  "author": "Inlife",
6
6
  "homepage": "https://www.nexrender.com",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "824d935a15b522de53e52d78c5fc1fa54864e3fa"
44
+ "gitHead": "3a39217ea769e9d086d65d8cd2538c14cc3826d6"
45
45
  }
package/src/index.js CHANGED
@@ -97,6 +97,7 @@ const init = (settings) => {
97
97
 
98
98
  // amount of seconds before job will be marked as "stuck"
99
99
  maxUpdateTimeout: process.env.NEXRENDER_MAX_UPDATE_TIMEOUT || 60,
100
+ killAEFXOnRenderTimeout: process.env.NEXRENDER_KILL_AEFX_ON_RENDER_TIMEOUT || false,
100
101
 
101
102
  __initialized: true,
102
103
  }, settings, {
@@ -1,6 +1,6 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
- const {spawn} = require('child_process')
3
+ const {spawn, exec} = require('child_process')
4
4
  const {expandEnvironmentVariables, checkForWSL} = require('../helpers/path')
5
5
 
6
6
  const translations = {
@@ -36,6 +36,29 @@ const crossPlatformKill = (instance) => {
36
36
  }
37
37
  }
38
38
 
39
+ function killProcessByName(settings, processName) {
40
+ if (process.platform !== 'win32') {
41
+ return;
42
+ }
43
+
44
+ const command = `taskkill /IM ${processName} /F`;
45
+
46
+ exec(command, (error, stdout, stderr) => {
47
+ if (error) {
48
+ settings.logger.log(`Error killing process: ${error.message}`);
49
+ return;
50
+ }
51
+
52
+ if (stderr) {
53
+ settings.logger.log(`Error: ${stderr}`);
54
+ return;
55
+ }
56
+
57
+ settings.logger.log(`Process ${processName} killed successfully.`);
58
+ settings.logger.log(stdout);
59
+ });
60
+ }
61
+
39
62
  /**
40
63
  * This task creates rendering process
41
64
  */
@@ -271,6 +294,8 @@ Estimated date of change to the new behavior: 2023-06-01.\n`);
271
294
  settings.trackSync('Job Render Failed', { job_id: job.uid, error: 'aerender_timeout' });
272
295
  reject(new Error(`Maximum rendering time exceeded`));
273
296
  crossPlatformKill(instance)
297
+ if (settings.killAEFXOnRenderTimeout)
298
+ killProcessByName('AfterFX.com')
274
299
  },
275
300
  timeout
276
301
  );