mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
bin scripts: Promisify db.init and db.close
This commit is contained in:
parent
0a61767901
commit
c622894fe0
1 changed files with 26 additions and 33 deletions
|
@ -71,11 +71,7 @@ const unescape = (val) => {
|
|||
if (!sqlFile) throw new Error('Use: node importSqlFile.js $SQLFILE');
|
||||
|
||||
log('initializing db');
|
||||
db.init((err) => {
|
||||
// there was an error while initializing the database, output it and stop
|
||||
if (err) {
|
||||
throw err;
|
||||
} else {
|
||||
await util.promisify(db.init.bind(db))();
|
||||
log('done');
|
||||
|
||||
log('open output file...');
|
||||
|
@ -104,9 +100,6 @@ const unescape = (val) => {
|
|||
process.stdout.write('done. waiting for db to finish transaction. ' +
|
||||
'depended on dbms this may take some time..\n');
|
||||
|
||||
db.close(() => {
|
||||
await util.promisify(db.close.bind(db))();
|
||||
log(`finished, imported ${keyNo} keys.`);
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue