mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 00:43:49 +01:00
[mastodon-client] Prevent updateUserInBackground from running excessively
This commit is contained in:
parent
062d256a67
commit
4748f30214
@ -528,9 +528,15 @@ export class UserHelpers {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static updateUserInBackground(user: User) {
|
public static async updateUserInBackground(user: User) {
|
||||||
if (Users.isLocalUser(user)) return;
|
if (Users.isLocalUser(user)) return;
|
||||||
// noinspection JSIgnoredPromiseFromCall
|
if (user.lastFetchedAt != null && Date.now() - user.lastFetchedAt.getTime() < 1000 * 60 * 60 * 24) return;
|
||||||
|
|
||||||
|
await Users.update(user.id, {
|
||||||
|
lastFetchedAt: new Date(),
|
||||||
|
});
|
||||||
|
|
||||||
|
// noinspection ES6MissingAwait
|
||||||
updatePerson(user.uri!, undefined, undefined, user as IRemoteUser);
|
updatePerson(user.uri!, undefined, undefined, user as IRemoteUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user