mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-21 17:37:29 -07:00
[mastodon-client] Prevent updateUserInBackground from running excessively
This commit is contained in:
parent
062d256a67
commit
4748f30214
1 changed files with 8 additions and 2 deletions
|
@ -528,9 +528,15 @@ export class UserHelpers {
|
|||
});
|
||||
}
|
||||
|
||||
public static updateUserInBackground(user: User) {
|
||||
public static async updateUserInBackground(user: User) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue