mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
moved settings loading into try/catch block
This commit is contained in:
@@ -30,20 +30,23 @@ module.exports = connectors => {
|
||||
// Create the context we'll use to perform user deletions.
|
||||
const ctx = Context.forSystem();
|
||||
|
||||
// Grab some settings.
|
||||
const { loaders: { Settings } } = ctx;
|
||||
const {
|
||||
organizationName,
|
||||
organizationContactEmail,
|
||||
} = await Settings.load(['organizationName', 'organizationContactEmail']);
|
||||
|
||||
// rescheduledDeletionDate is the date in the future that we'll set the
|
||||
// user's account to be deleted on if this delete fails.
|
||||
const rescheduledDeletionDate = moment()
|
||||
.add(1, 'hours')
|
||||
.toDate();
|
||||
|
||||
try {
|
||||
// Grab some settings.
|
||||
const { loaders: { Settings } } = ctx;
|
||||
const {
|
||||
organizationName,
|
||||
organizationContactEmail,
|
||||
} = await Settings.load([
|
||||
'organizationName',
|
||||
'organizationContactEmail',
|
||||
]);
|
||||
|
||||
// rescheduledDeletionDate is the date in the future that we'll set the
|
||||
// user's account to be deleted on if this delete fails.
|
||||
const rescheduledDeletionDate = moment()
|
||||
.add(1, 'hours')
|
||||
.toDate();
|
||||
|
||||
// Keep running for each user we can pull.
|
||||
while (true) {
|
||||
// We'll find any user that has an account deletion date before now
|
||||
|
||||
Reference in New Issue
Block a user