Update main.js
This commit is contained in:
parent
156e2ec79e
commit
dca5f2e31a
1 changed files with 3 additions and 3 deletions
6
main.js
6
main.js
|
@ -51,15 +51,15 @@ async function main() {
|
|||
|
||||
const users = response.data;
|
||||
const now = new Date();
|
||||
const TimeAgo = new Date(now - PERIOD * 24 * 60 * 60 * 1000);
|
||||
const timeAgo = new Date(now - PERIOD * 24 * 60 * 60 * 1000);
|
||||
|
||||
const usersToDelete = users.filter(user => {
|
||||
const createdAt = new Date(user.createdAt);
|
||||
const updatedAt = new Date(user.updatedAt);
|
||||
const excludedUsers = ['instance.actor', 'relay.actor'];
|
||||
return user.notesCount === 0 &&
|
||||
createdAt < fiveDaysAgo &&
|
||||
updatedAt < fiveDaysAgo &&
|
||||
createdAt < timeAgo &&
|
||||
updatedAt < timeAgo &&
|
||||
!excludedUsers.includes(user.username)
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue