BURs: update posts in parallel.
When processing an alias, rename, implication, mass update, or nuke, update the posts in parallel. This means that if we alias foo to bar, for example, then we use four processes at once to retag the posts from foo to bar. This doesn't mean that if we have two aliases in a BUR, we process both aliases in parallel. It simply means that when processing an alias, we update the posts in parallel for that alias.
This commit is contained in:
@@ -266,6 +266,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
|
||||
should "update the tags" do
|
||||
assert_equal("bar", @post.reload.tag_string)
|
||||
assert_equal("approved", @bur.reload.status)
|
||||
assert_equal(User.system, @post.versions.last.updater)
|
||||
end
|
||||
|
||||
should "be case-sensitive" do
|
||||
@@ -288,6 +289,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
|
||||
should "rename the tags" do
|
||||
assert_equal("bar blah", @post.reload.tag_string)
|
||||
assert_equal("approved", @bur.reload.status)
|
||||
assert_equal(User.system, @post.versions.last.updater)
|
||||
end
|
||||
|
||||
should "move the tag's artist entry and wiki page" do
|
||||
@@ -351,6 +353,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
|
||||
|
||||
assert_equal("foo", @post.reload.tag_string)
|
||||
assert_equal("approved", @bur.reload.status)
|
||||
assert_equal(User.system, @post.versions.last.updater)
|
||||
end
|
||||
|
||||
should "remove implications" do
|
||||
@@ -370,6 +373,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
|
||||
|
||||
assert_equal([], @pool.post_ids)
|
||||
assert_equal("approved", @bur.reload.status)
|
||||
assert_equal(User.system, @pool.versions.last.updater)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -514,6 +518,10 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
|
||||
assert_equal("approved", @bur.reload.status)
|
||||
end
|
||||
|
||||
should "update the post as DanbooruBot" do
|
||||
assert_equal(User.system, @post.versions.last.updater)
|
||||
end
|
||||
|
||||
should "set the BUR as failed if there is an unexpected error during processing" do
|
||||
@bur = create(:bulk_update_request, script: "alias one -> two")
|
||||
TagAlias.any_instance.stubs(:process!).raises(RuntimeError.new("oh no"))
|
||||
|
||||
Reference in New Issue
Block a user