Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower the limit for tag category changes #3448

Closed
BrokenEagle opened this issue Dec 21, 2017 · 1 comment
Closed

Lower the limit for tag category changes #3448

BrokenEagle opened this issue Dec 21, 2017 · 1 comment

Comments

@BrokenEagle
Copy link
Collaborator

Talked about this with @evazion on Discord, where I asked him how long it takes to do a category tag change with 10K posts. The following is the results from that, with the tag count of "partially translated" being approximate to 10K.
http://devbooru.tk:3000/tags?search[name]=partially_translated

[7] pry(main)> Benchmark.realtime { Tag.find_or_create_by_name("partially_translated").update_category_post_counts }
(621235.3ms) => 621.234996182844

So about 10 minutes. A single one of these wouldn't break the site, but multiple ones could. Even discounting performance issues, such large changes really should be discussed on the forum, and then validated by an Admin.

Lowering the limit to 1000 instead should be sufficient for most tag gardening cleanup required of Builder+ users.

@evazion
Copy link
Member

evazion commented Dec 23, 2017

I see there's also a bug with Tag#editable_by? not enforcing the same limits as Tag#find_or_create_by_name. Consequently builders can still change large tags with /tags/1234/edit.

evazion added a commit to evazion/danbooru that referenced this issue Dec 23, 2017
Also allow admins to bypass all restrictions.
r888888888 added a commit that referenced this issue Dec 25, 2017
Fix #3448: Lower the limit for tag category changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants