]> cat aescling's git repositories - mastodon.git/commit
Add option to exclude suspended domains/subdomains from tootctl domains crawl (#11454)
authorDarius Kazemi <darius.kazemi@gmail.com>
Sat, 3 Aug 2019 17:11:09 +0000 (10:11 -0700)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 3 Aug 2019 17:11:09 +0000 (19:11 +0200)
commitf96f45ef12341648cb8d79d9b70f8c5636f98f64
tree25b1c0473023fb30f5d026ffd3dcd688d15a9aea
parentc8fd82332749cd58f85dd398d32559a02499c945
Add option to exclude suspended domains/subdomains from tootctl domains crawl (#11454)

* Add "--exclude-suspended" to tootctl domains crawl

This new option ignores any instances suspended server-wide as
well as their associated subdomains. This queries all domain
blocks up front, then runs a regexp on each domain. This improves
performance over what may be the obvious implementation, which is
to ask `DomainBlocks.blocked?(domain)` for each domain -- this
hits the DB many times, slowing things down considerably.

* cleaning up code style

* Compiling regex

* Removing ternary operator
lib/mastodon/domains_cli.rb