AuthorManager: await db.set in createAuthor
parent
20c512c8a9
commit
35797e57fc
|
@ -156,13 +156,13 @@ async function mapAuthorWithDBKey(mapperkey, mapper) {
|
||||||
|
|
||||||
// return the author
|
// return the author
|
||||||
return {authorID: author};
|
return {authorID: author};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal function that creates the database entry for an author
|
* Internal function that creates the database entry for an author
|
||||||
* @param {String} name The name of the author
|
* @param {String} name The name of the author
|
||||||
*/
|
*/
|
||||||
exports.createAuthor = (name) => {
|
exports.createAuthor = async (name) => {
|
||||||
// create the new author name
|
// create the new author name
|
||||||
const author = `a.${randomString(16)}`;
|
const author = `a.${randomString(16)}`;
|
||||||
|
|
||||||
|
@ -174,8 +174,7 @@ exports.createAuthor = (name) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// set the global author db entry
|
// set the global author db entry
|
||||||
// NB: no await, since we're not waiting for the DB set to finish
|
await db.set(`globalAuthor:${author}`, authorObj);
|
||||||
db.set(`globalAuthor:${author}`, authorObj);
|
|
||||||
|
|
||||||
return {authorID: author};
|
return {authorID: author};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue