mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 13:27:31 -07:00
skip if actor is not found or has been already deleted
This commit is contained in:
parent
50c206af7d
commit
91acab8860
2 changed files with 6 additions and 6 deletions
|
@ -17,9 +17,7 @@ export async function deleteAccount(
|
||||||
logger.info(`Deleting account of ${job.data.user.id} ...`);
|
logger.info(`Deleting account of ${job.data.user.id} ...`);
|
||||||
|
|
||||||
const user = await Users.findOneBy({ id: job.data.user.id });
|
const user = await Users.findOneBy({ id: job.data.user.id });
|
||||||
if (user == null) {
|
if (!user) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Delete notes
|
// Delete notes
|
||||||
|
|
|
@ -15,9 +15,11 @@ export async function deleteActor(
|
||||||
return `skip: delete actor ${actor.uri} !== ${uri}`;
|
return `skip: delete actor ${actor.uri} !== ${uri}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = await Users.findOneByOrFail({ id: actor.id });
|
const user = await Users.findOneBy({ id: actor.id });
|
||||||
if (user.isDeleted) {
|
if (!user) {
|
||||||
logger.info("skip: already deleted");
|
return `skip: actor ${actor.id} not found in the local database`;
|
||||||
|
} else if (user.isDeleted) {
|
||||||
|
return `skip: user ${user.id} already deleted`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const job = await createDeleteAccountJob(actor);
|
const job = await createDeleteAccountJob(actor);
|
||||||
|
|
Loading…
Reference in a new issue