Explorar o código

Move settings invocation to init phase

Gaël Métais %!s(int64=4) %!d(string=hai) anos
pai
achega
c5bc02d45d
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lib/screenshotHandler.js

+ 2 - 1
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);