From e81a052f66e7322a23a37d7aea723761519a0b89 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Wed, 30 Nov 2022 15:27:53 -0600 Subject: [PATCH] fix(lint): line lengths and so on --- website/server/libs/cron.js | 4 +--- website/server/models/subscriptionPlan.js | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/website/server/libs/cron.js b/website/server/libs/cron.js index 3555f36836..7b2acf2eaa 100644 --- a/website/server/libs/cron.js +++ b/website/server/libs/cron.js @@ -63,9 +63,6 @@ const CLEAR_BUFFS = { }; async function grantEndOfTheMonthPerks (user, now) { - // multi-month subscriptions are for multiples of 3 months - const SUBSCRIPTION_BASIC_BLOCK_LENGTH = 3; - const { plan, elapsedMonths } = getPlanContext(user, now); if (elapsedMonths > 0) { @@ -115,6 +112,7 @@ async function grantEndOfTheMonthPerks (user, now) { // (subtract 1 because we should have run this when the payment was taken last month) plan.consecutive.offset = planMonthsLength - 1; } + // eslint-disable-next-line no-await-in-loop await plan.incrementPerkCounterAndReward(user._id, planMonthsLength); } } diff --git a/website/server/models/subscriptionPlan.js b/website/server/models/subscriptionPlan.js index 7b93a81b92..2095c4b6d9 100644 --- a/website/server/models/subscriptionPlan.js +++ b/website/server/models/subscriptionPlan.js @@ -47,7 +47,8 @@ schema.plugin(baseModel, { _id: false, }); -schema.methods.incrementPerkCounterAndReward = async function incrementPerkCounterAndReward (userID, adding) { +schema.methods.incrementPerkCounterAndReward = async function incrementPerkCounterAndReward +(userID, adding) { this.perkMonthCount += adding; const perks = Math.floor(this.perkMonthCount / 3);