mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
async-ify more functions, and await completion
Where feasible I put the await at the end of the function to minimize the impact on latency. My motivation for this change: Eliminate a race condition in tests I am writing.
This commit is contained in:
parent
45ec8326f0
commit
3365e944bf
8 changed files with 78 additions and 70 deletions
|
@ -200,10 +200,11 @@ exports.isValidPadId = function(padId)
|
|||
/**
|
||||
* Removes the pad from database and unloads it.
|
||||
*/
|
||||
exports.removePad = function(padId) {
|
||||
db.remove("pad:" + padId);
|
||||
exports.removePad = async (padId) => {
|
||||
const p = db.remove('pad:' + padId);
|
||||
exports.unloadPad(padId);
|
||||
padList.removePad(padId);
|
||||
await p;
|
||||
}
|
||||
|
||||
// removes a pad from the cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue