guumaster / hostctl

Your dev tool to manage /etc/hosts like a pro!
http://guumaster.github.io/hostctl
MIT License
1.04k stars 45 forks source link

Unable to handle big profile files #53

Closed smhmd closed 4 years ago

smhmd commented 4 years ago

Describe the bug I have a profile file with 23,000 lines that used to work just fine. With 1.0.0 (and now 1.0.2), hostctl no longer works. hostctl status didn't work. I removed all profiles to start fresh and the big file would not be added --from.

To Reproduce Steps to reproduce the behavior:

  1. sudo hostctl add nsfw --from https://github.com/smhmd/dotfiles/blob/master/.config/hosts/nsfw -q (there's an idea. Profile files --from URLs.)

Expected behavior hostctl to load the profile

System OS: Linux

Additional context Loading that profile worked in 0.10.x.

guumaster commented 4 years ago

It does work, but it take 4 or 5 minutes if you add -q or not. I'll look into it.

smhmd commented 4 years ago

For a point of reference, it was as instantaneous as you can cat the file in 0.x.

guumaster commented 4 years ago

fixed on v1.0.3. tested with your example profile.

guumaster commented 4 years ago

as reference, the issue was related to the uniqueness check of domains on a profile. I removed the check for now.

smhmd commented 4 years ago

You can add it as a flag -u,--uniq?

guumaster commented 4 years ago

added --uniq to v1.0.4 :+1: