aliases/implications: don't retry if approving fails.
This was originally meant to deal with statement timeouts when updating tags. This is no longer a problem.
This commit is contained in:
@@ -53,9 +53,6 @@ class TagAlias < TagRelationship
|
||||
raise errors.full_messages.join("; ")
|
||||
end
|
||||
|
||||
tries = 0
|
||||
|
||||
begin
|
||||
CurrentUser.scoped(User.system) do
|
||||
update!(status: "processing")
|
||||
move_aliases_and_implications
|
||||
@@ -67,12 +64,6 @@ class TagAlias < TagRelationship
|
||||
update!(status: "active")
|
||||
end
|
||||
rescue Exception => e
|
||||
if tries < 5
|
||||
tries += 1
|
||||
sleep 2**tries
|
||||
retry
|
||||
end
|
||||
|
||||
CurrentUser.scoped(approver) do
|
||||
forum_updater.update(failure_message(e), "FAILED") if update_topic
|
||||
update(status: "error: #{e}")
|
||||
@@ -80,7 +71,6 @@ class TagAlias < TagRelationship
|
||||
|
||||
DanbooruLogger.log(e, tag_alias_id: id, antecedent_name: antecedent_name, consequent_name: consequent_name)
|
||||
end
|
||||
end
|
||||
|
||||
def absence_of_transitive_relation
|
||||
return if is_rejected?
|
||||
|
||||
@@ -131,9 +131,6 @@ class TagImplication < TagRelationship
|
||||
raise errors.full_messages.join("; ")
|
||||
end
|
||||
|
||||
tries = 0
|
||||
|
||||
begin
|
||||
CurrentUser.scoped(User.system) do
|
||||
update(status: "processing")
|
||||
update_posts
|
||||
@@ -142,18 +139,11 @@ class TagImplication < TagRelationship
|
||||
forum_updater.update(approval_message(approver), "APPROVED") if update_topic
|
||||
end
|
||||
rescue Exception => e
|
||||
if tries < 5
|
||||
tries += 1
|
||||
sleep 2**tries
|
||||
retry
|
||||
end
|
||||
|
||||
forum_updater.update(failure_message(e), "FAILED") if update_topic
|
||||
update(status: "error: #{e}")
|
||||
|
||||
DanbooruLogger.log(e, tag_implication_id: id, antecedent_name: antecedent_name, consequent_name: consequent_name)
|
||||
end
|
||||
end
|
||||
|
||||
def approve!(approver: CurrentUser.user, update_topic: true)
|
||||
update(approver: approver, status: "queued")
|
||||
|
||||
Reference in New Issue
Block a user