Skip to content

Commit

Permalink
Removed fs-extra, replaced with rimraf, because the tests were lockin…
Browse files Browse the repository at this point in the history
…g up the system due to too many open file descriptors on bootup, while trying to remove the temporary files folder.
  • Loading branch information
silvae86 committed May 10, 2018
1 parent 622dc15 commit b271b50
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 41 deletions.
23 changes: 0 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"file-size": "^1.0.0",
"file-stream-rotator": "^0.2.0",
"font-awesome-filetypes": "1.2.0",
"fs-extra": "^5.0.0",
"gladstone": "git+https://github.com/little9/gladstone.git",
"gridfs-stream": "^1.1.1",
"grunt": "^1.0.1",
Expand Down Expand Up @@ -143,6 +142,7 @@
"request": "^2.83.0",
"request-promise-native": "^1.0.5",
"restler": "^3.4.0",
"rimraf": "^2.6.2",
"rmdir": "^1.2.0",
"semaphore": "^1.1.0",
"serve-favicon": "^2.4.5",
Expand Down
21 changes: 5 additions & 16 deletions src/bootup/init/init_temp_folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const initTempFilesFolder = function (app, callback)
if (Config.debug.files.delete_temp_folder_on_startup)
{
Logger.log_boot_message("Deleting temp files dir at " + Config.tempFilesDir);
const fsextra = require("fs-extra");
fsextra.remove(Config.tempFilesDir, function (err)
const rimraf = require("rimraf");
rimraf.remove(Config.tempFilesDir, function (err)
{
if (isNull(err))
{
Expand All @@ -38,20 +38,9 @@ const initTempFilesFolder = function (app, callback)
},
function (cb)
{
const fsextra = require("fs-extra");
fsextra.exists(Config.tempFilesDir, function (exists)
{
if (!exists)
{
mkdirp.sync(Config.tempFilesDir);
Logger.log_boot_message("Temporary files directory successfully created at " + Config.tempFilesDir);
cb();
}
else
{
cb(null);
}
});
mkdirp.sync(Config.tempFilesDir);
Logger.log_boot_message("Temporary files directory successfully created at " + Config.tempFilesDir);
cb();
}
], function (err)
{
Expand Down
1 change: 0 additions & 1 deletion src/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ Logger.init = function (startTime)

mkdirp.sync(path.join(absPath, env, fileNameDateSection));

const fsExtra = require("fs-extra");
fsExtra.ensureFileSync(logFilePath);
fsExtra.ensureFileSync(errorLogFilePath);

Expand Down

0 comments on commit b271b50

Please sign in to comment.