mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-16 16:37:12 +03:00
do user & IP queries asynchronously in checkbanStatus()
Co-authored-by: Kendell R <KTibow@users.noreply.github.com>
This commit is contained in:
@@ -15,8 +15,7 @@ export async function isIPBanned(ip: HashedIP): Promise<boolean> {
|
||||
|
||||
// NOTE: this function will propagate IP bans
|
||||
export async function checkBanStatus(userID: HashedUserID, ip: HashedIP): Promise<boolean> {
|
||||
const userBanStatus = await isUserBanned(userID);
|
||||
const ipBanStatus = await isIPBanned(ip);
|
||||
const [userBanStatus, ipBanStatus] = await Promise.all([isUserBanned(userID), isIPBanned(ip)]);
|
||||
|
||||
if (!userBanStatus && ipBanStatus) {
|
||||
// Make sure the whole user is banned
|
||||
|
||||
Reference in New Issue
Block a user