diff --git a/packages/fxa-auth-server/lib/routes/cloud-scheduler.ts b/packages/fxa-auth-server/lib/routes/cloud-scheduler.ts index 3adcf61019..b187f57971 100644 --- a/packages/fxa-auth-server/lib/routes/cloud-scheduler.ts +++ b/packages/fxa-auth-server/lib/routes/cloud-scheduler.ts @@ -4,13 +4,16 @@ import { ConfigType } from '../../config'; import { AuthLogger, AuthRequest } from '../types'; -import { processDateRange } from '../../scripts/delete-unverified-accounts'; +// commenting this out for now because the script uses p-queue, which is pure +// ESM since 7.x. That won't work when nodejs try to `require` it. +// import { processDateRange } from '../../scripts/delete-unverified-accounts'; import { AccountTasks, AccountTasksFactory, - ReasonForDeletion, + // ReasonForDeletion, } from '@fxa/shared/cloud-tasks'; import { StatsD } from 'hot-shots'; +import error from '../error'; const MILLISECONDS_IN_A_DAY = 24 * 60 * 60 * 1000; @@ -30,28 +33,30 @@ export class CloudSchedulerHandler { } async deleteUnverifiedAccounts() { - const { sinceDays, durationDays, taskLimit } = - this.config.cloudScheduler.deleteUnverifiedAccounts; - const endDate = this.calculateDate(sinceDays); - const startDate = this.calculateDate(sinceDays + durationDays); - const reason = ReasonForDeletion.Unverified; + return error.featureNotEnabled(); - this.log.info('Deleting unverified accounts', { - initiatedAt: new Date().toISOString(), - endDate: endDate.toISOString(), - startDate: startDate.toISOString(), - }); - this.statsd.increment('cloud-scheduler.deleteUnverifiedAccounts'); - await processDateRange( - this.config, - this.accountTasks, - reason, - startDate.getTime(), - endDate.getTime(), - taskLimit - ); + // const { sinceDays, durationDays, taskLimit } = + // this.config.cloudScheduler.deleteUnverifiedAccounts; + // const endDate = this.calculateDate(sinceDays); + // const startDate = this.calculateDate(sinceDays + durationDays); + // const reason = ReasonForDeletion.Unverified; - return {}; + // this.log.info('Deleting unverified accounts', { + // initiatedAt: new Date().toISOString(), + // endDate: endDate.toISOString(), + // startDate: startDate.toISOString(), + // }); + // this.statsd.increment('cloud-scheduler.deleteUnverifiedAccounts'); + // await processDateRange( + // this.config, + // this.accountTasks, + // reason, + // startDate.getTime(), + // endDate.getTime(), + // taskLimit + // ); + + // return {}; } } diff --git a/packages/fxa-auth-server/test/local/routes/cloud-scheduler.js b/packages/fxa-auth-server/test/local/routes/cloud-scheduler.js index 175e011e74..a914babe19 100644 --- a/packages/fxa-auth-server/test/local/routes/cloud-scheduler.js +++ b/packages/fxa-auth-server/test/local/routes/cloud-scheduler.js @@ -3,7 +3,7 @@ const assert = { ...sinon.assert, ...require('chai').assert }; import { ReasonForDeletion } from '@fxa/shared/cloud-tasks'; import proxyquire from 'proxyquire'; -describe('CloudSchedulerHandler', function () { +describe.skip('CloudSchedulerHandler', function () { this.timeout(10000); let cloudSchedulerHandler;