Skip to content

Commit

Permalink
remove locked cache on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
jfromaniello committed Mar 8, 2016
1 parent bf8462c commit eaac5c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ var levelup = require('levelup');
var ttl = require('level-ttl');
var spaces = require('level-spaces');
var nconf = require('nconf');
var fs = require('fs');
var rimraf = require('rimraf');
var path = require('path');

var db_path = nconf.get('CACHE_FILE');

if (fs.existsSync(path.join(db_path, 'LOCK'))) {
rimraf.sync(db_path);
}

var db = levelup(nconf.get('CACHE_FILE'));

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"passport-windowsauth": "~0.4.1",
"randomstring": "~1.0.3",
"request": "~2.16.6",
"rimraf": "~2.5.2",
"selfsigned": "~1.2.0",
"stream-rotate": "0.0.4",
"thumbprint": "0.0.1",
Expand Down

0 comments on commit eaac5c7

Please sign in to comment.