mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-02-01 07:10:55 +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
|
// NOTE: this function will propagate IP bans
|
||||||
export async function checkBanStatus(userID: HashedUserID, ip: HashedIP): Promise<boolean> {
|
export async function checkBanStatus(userID: HashedUserID, ip: HashedIP): Promise<boolean> {
|
||||||
const userBanStatus = await isUserBanned(userID);
|
const [userBanStatus, ipBanStatus] = await Promise.all([isUserBanned(userID), isIPBanned(ip)]);
|
||||||
const ipBanStatus = await isIPBanned(ip);
|
|
||||||
|
|
||||||
if (!userBanStatus && ipBanStatus) {
|
if (!userBanStatus && ipBanStatus) {
|
||||||
// Make sure the whole user is banned
|
// Make sure the whole user is banned
|
||||||
|
|||||||
Reference in New Issue
Block a user