Skip to content
Snippets Groups Projects
Commit 74264e50 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Fix: "reset peers" was broken

parent 7b5f4f90
No related branches found
No related tags found
No related merge requests found
...@@ -1225,6 +1225,7 @@ function FileDAL(profile, home, localDir, myFS, parentFileDAL, dalName, loki) { ...@@ -1225,6 +1225,7 @@ function FileDAL(profile, home, localDir, myFS, parentFileDAL, dalName, loki) {
return co(function *() { return co(function *() {
that.peerDAL.lokiRemoveAll(); that.peerDAL.lokiRemoveAll();
yield resetFiles(files, dirs); yield resetFiles(files, dirs);
return that.close();
}) })
.then(() => done && done()) .then(() => done && done())
.catch((err) => done && done(err)); .catch((err) => done && done(err));
......
...@@ -435,7 +435,8 @@ program ...@@ -435,7 +435,8 @@ program
.command('reset [config|data|peers|tx|stats|all]') .command('reset [config|data|peers|tx|stats|all]')
.description('Reset configuration, data, peers, transactions or everything in the database') .description('Reset configuration, data, peers, transactions or everything in the database')
.action((type) => { .action((type) => {
connect(function (server) { let init = type != 'peers' ? connect : service;
init(function (server) {
if(!~['config', 'data', 'peers', 'tx', 'stats', 'all'].indexOf(type)){ if(!~['config', 'data', 'peers', 'tx', 'stats', 'all'].indexOf(type)){
logger.error('Bad command: usage `reset config`, `reset data`, `reset peers`, `reset tx`, `reset stats` or `reset all`'); logger.error('Bad command: usage `reset config`, `reset data`, `reset peers`, `reset tx`, `reset stats` or `reset all`');
server.disconnect(); server.disconnect();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment