Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0ef3a29

Browse files
committed
removed unnecessary await (optimization)
1 parent cc1a4bc commit 0ef3a29

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

‎src/jobs/accountCleanup.js‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports.removeUnconfirmedAccounts = async () => {
3737
accounts = accounts.filter(account => Date.parse(account.createdAt) < Date.now() - MAX_UNCONFIRMED_ACCOUNT_AGE);
3838
const accountIds = accounts.map(account => account.id);
3939

40-
awaitPromise.all([
40+
Promise.all([
4141
Events.findAll({
4242
where: {
4343
ownerId: { [Op.in]: accountIds },
@@ -69,16 +69,14 @@ module.exports.emailConfirmationRemainder = async () => {
6969

7070
// find and retreive all the users with an unconfirmed email address
7171

72-
let accounts = await User.findAll(
73-
{
74-
where:
75-
{
76-
confirmed_email: false,
77-
},
78-
attributes: ['id', 'createdAt', 'username', 'email'],
79-
raw: true,
72+
let accounts = await User.findAll({
73+
where: {
74+
confirmed_email: false,
8075
},
81-
)
76+
attributes: ['id', 'createdAt', 'username', 'email'],
77+
raw: true,
78+
})
79+
8280
if (!accounts?.length) {
8381
return;
8482
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /