Don't create new transactions if we already have one
Change-Id: Ife6c14c0c9f373af8c8f675dfe68304e44cd9ac8 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318157 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Aaron Ogata <aogata@instructure.com> QA-Review: Jacob Burroughs <jburroughs@instructure.com> Product-Review: Jacob Burroughs <jburroughs@instructure.com>
This commit is contained in:
parent
2863c4dd27
commit
3a0d2d7c1b
|
@ -258,10 +258,17 @@ module PostgreSQLAdapterExtensions
|
|||
end
|
||||
|
||||
def with_max_update_limit(limit)
|
||||
transaction do
|
||||
if current_transaction
|
||||
execute("SET LOCAL inst.max_update_limit = #{limit}")
|
||||
yield
|
||||
ret = yield
|
||||
execute("SET LOCAL inst.max_update_limit = DEFAULT")
|
||||
else
|
||||
transaction do
|
||||
execute("SET LOCAL inst.max_update_limit = #{limit}")
|
||||
ret = yield
|
||||
end
|
||||
end
|
||||
ret
|
||||
end
|
||||
|
||||
def quote(*args)
|
||||
|
|
Loading…
Reference in New Issue