FriendsOfFlarum/ban-ips

Improve performance in BannedIPRepository

dsevillamartin opened this issue · 2 comments

Currently, the code plucks the IP addresses from the user's posts and removes duplicates to retrieve a user's IP addresses.

This would most likely be a big performance hit in a big forum with tons of posts.

Performance can probably also be improved when seeing what users have an IP address, as posts with that IP address are looped, plucked users, removed duplicates, and filtered to make sure the users cannot ban IPs.

https://github.com/FriendsOfFlarum/ban-ips/blob/06e2bb52d76b58b3cb5a93ce7c584c93fd6a8ffa/src/Repositories/BannedIPRepository.php

Looks to be done.

Really what changed? 😅👌