Skip to content

Commit

Permalink
fix: fix a bug ban user clean cache will be have a gap between userin…
Browse files Browse the repository at this point in the history
…fo and token cache #179

we must make sure user cache will be clean first and clean token cache second
then user will not been get old user  cache in next token cache generate
  • Loading branch information
moonrailgun committed Nov 18, 2023
1 parent 0be2bf6 commit 7e239ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/services/core/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,16 @@ class UserService extends TcService {
}
);

this.cleanUserInfoCache(userId);
await this.cleanUserInfoCache(userId);
const tokens = await ctx.call('gateway.getUserSocketToken', {
userId,
});
if (Array.isArray(tokens)) {
tokens.map((token) => this.cleanActionCache('resolveToken', [token]));
await Promise.all(
tokens.map((token) => this.cleanActionCache('resolveToken', [token]))
);
}

await ctx.call('gateway.tickUser', {
userId,
});
Expand Down

0 comments on commit 7e239ea

Please sign in to comment.