Skip to content

Commit f85d4ea

Browse files
BrRenatAVVS
authored andcommitted
fix: added clear cache after remove user (#426)
1 parent f6e1f97 commit f85d4ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/actions/remove.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,15 @@ async function removeUser({ params }) {
106106
transaction.del(key(THROTTLE_PREFIX, USERS_ACTION_RESET, userId));
107107

108108
// complete it
109-
return transaction
109+
const removeResult = await transaction
110110
.exec()
111111
.then(handlePipeline);
112+
113+
// clear cache
114+
const now = Date.now();
115+
await Promise.all([redis.fsortBust(USERS_INDEX, now), redis.fsortBust(USERS_PUBLIC_INDEX, now)]);
116+
117+
return removeResult;
112118
}
113119

114120
removeUser.transports = [ActionTransport.amqp];

0 commit comments

Comments
 (0)