Поправки багов

This commit is contained in:
Book Pauk
2018-12-26 22:08:55 +07:00
parent 4c3f175e71
commit 5e07fdc750
4 changed files with 8 additions and 8 deletions

View File

@@ -153,11 +153,11 @@ class FileLog extends BaseLog {
}, LOG_ROTATE_FILE_CHECK_INTERVAL);
};
await fs.writeAsync(this.fd, new Buffer(data.join('')));
await fs.writeAsync(this.fd, Buffer.from(data.join('')));
}
flushImplSync(data) {
fs.writeSync(this.fd, new Buffer(data.join('')));
fs.writeSync(this.fd, Buffer.from(data.join('')));
}
}

View File

@@ -6,15 +6,16 @@ const waitingDelay = 100; //ms
class SqliteConnectionPool {
constructor(connCount, logger, config) {
this.config = config;
this.connCount = connCount;
this.logger = logger;
this.config = config;
}
async init() {
this.logger.log('Opening database');
utils.mkDirIfNotExistsSync(config.dataDir);
const dbFileName = config.dataDir + '/' + config.dbFileName;
utils.mkDirIfNotExistsSync(this.config.dataDir);
const dbFileName = this.config.dataDir + '/' + this.config.dbFileName;
this.connections = [];
this.taken = new Set();

View File

@@ -13,7 +13,6 @@ function statPathSync(path) {
}
function mkDirIfNotExistsSync(path) {
console.log(path);
let exists = statPathSync(path);
if (!exists) {
fs.mkdirSync(path, {recursive: true, mode: 0o755});