mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Pad: drop one Promise.all call as saveToDatabase
and addPad
already use await
This commit is contained in:
parent
c93a6194a2
commit
32806c31fd
1 changed files with 4 additions and 8 deletions
|
@ -92,15 +92,11 @@ Pad.prototype.appendRevision = async function (aChangeset, author) {
|
||||||
newRevData.meta.atext = this.atext;
|
newRevData.meta.atext = this.atext;
|
||||||
}
|
}
|
||||||
|
|
||||||
const p = [
|
this.saveToDatabase();
|
||||||
db.set(`pad:${this.id}:revs:${newRev}`, newRevData),
|
const p_newRevData = db.set(`pad:${this.id}:revs:${newRev}`, newRevData);
|
||||||
this.saveToDatabase(),
|
|
||||||
];
|
|
||||||
|
|
||||||
// set the author to pad
|
// set the author to pad
|
||||||
if (author) {
|
if (author) authorManager.addPad(author, this.id);
|
||||||
p.push(authorManager.addPad(author, this.id));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.head === 0) {
|
if (this.head === 0) {
|
||||||
hooks.callAll('padCreate', {pad: this, author});
|
hooks.callAll('padCreate', {pad: this, author});
|
||||||
|
@ -108,7 +104,7 @@ Pad.prototype.appendRevision = async function (aChangeset, author) {
|
||||||
hooks.callAll('padUpdate', {pad: this, author, revs: newRev, changeset: aChangeset});
|
hooks.callAll('padUpdate', {pad: this, author, revs: newRev, changeset: aChangeset});
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all(p);
|
await p_newRevData;
|
||||||
};
|
};
|
||||||
|
|
||||||
// save all attributes to the database
|
// save all attributes to the database
|
||||||
|
|
Loading…
Reference in a new issue