mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #33852 from overleaf/kc-schedule-domain-verification
[web] schedule domain reverification GitOrigin-RevId: 08217692960379d0a6f7ce457032b1182fb2bf4e
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
import { scriptRunner } from './lib/ScriptRunner.mjs'
|
||||||
|
import DomainVerificationCron from '../modules/group-settings/app/src/DomainVerificationCron.mjs'
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
await DomainVerificationCron.promises.verifyAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await scriptRunner(main)
|
||||||
|
process.exit(0)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/* eslint-disable no-unused-vars */
|
||||||
|
|
||||||
|
import Helpers from './lib/helpers.mjs'
|
||||||
|
|
||||||
|
const tags = ['saas', 'nonblocking']
|
||||||
|
|
||||||
|
// Supports the daily scheduler query in scripts/verify_domains.mjs which
|
||||||
|
// filters on status and lastVerificationAttemptAt.
|
||||||
|
const indexes = [
|
||||||
|
{
|
||||||
|
key: { status: 1, lastVerificationAttemptAt: 1 },
|
||||||
|
name: 'status_1_lastVerificationAttemptAt_1',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const migrate = async client => {
|
||||||
|
const { db } = client
|
||||||
|
|
||||||
|
await Helpers.addIndexesToCollection(db.domainVerifications, indexes)
|
||||||
|
}
|
||||||
|
|
||||||
|
const rollback = async client => {
|
||||||
|
const { db } = client
|
||||||
|
await Helpers.dropIndexesFromCollection(db.domainVerifications, indexes)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
tags,
|
||||||
|
migrate,
|
||||||
|
rollback,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user