From c5bc02d45d1c28ff591760fccc486f7888c730ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Tue, 16 Mar 2021 07:45:10 +0000 Subject: [PATCH] Move settings invocation to init phase --- lib/screenshotHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/screenshotHandler.js b/lib/screenshotHandler.js index 529821f..8221145 100644 --- a/lib/screenshotHandler.js +++ b/lib/screenshotHandler.js @@ -4,6 +4,8 @@ var Q = require('q'); var fs = require('fs'); var path = require('path'); +var serverSettings = require('../server_config/settings.json'); + var screenshotHandler = function() { @@ -110,7 +112,6 @@ var screenshotHandler = function() { // Chrome saves a temporary file on the disk, which is then removed. // Its default folder is /tmp, but it can be changed in server_config/settings.json - var serverSettings = require('../server_config/settings.json'); var tmpFolderPath = serverSettings.screenshotTempPath || '/tmp'; var tmpFileName = 'temp-chrome-screenshot.png'; var tmpFileFullPath = path.join(tmpFolderPath, tmpFileName);