order of operations fix
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Erik 2023-04-01 15:28:17 +03:00
parent 7f065f427f
commit 911fcae536
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68
3 changed files with 4 additions and 2 deletions

View File

@ -266,8 +266,8 @@ class UserDatabase extends UserDatabaseInterface {
const user = this._createUser({
name
});
await this.#db.insertOne(this._userColllection, user.jsonPrivate);
await user.setPassword(password);
await this.#db.insertOne(this._userColllection, user.jsonPrivate);
// await this.updateUser(user);
if (!this.disableCache)
this.cache.set(user.id, user);

View File

@ -91,6 +91,8 @@ class MariaDB {
async close () {
this.logger.status(`Shutting down database connections`);
if (!this.ready)
return Promise.resolve();
this.ready = false;
if (this.activeQueries) {
this.logger.info(`${this.activeQueries} active queries still running, letting them finish`);

View File

@ -49,7 +49,7 @@ class User extends AbstractUser {
}
get passwordLoginEnabled () {
return this._passwordHash !== null;
return this.#passwordHash !== null;
}
get avatar () {