fix: fix a bug ban user clean cache will be have a gap between userinfo 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
chore/devcontainer
moonrailgun 1 year ago
parent 0be2bf6c47
commit 7e239ead86

@ -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,
});

Loading…
Cancel
Save