MT#63706 skip_locked for POST /api/subscriber/

add the SELECT .. SKIP LOCK mechanism for POST /api/subscriber/,
to reduce lock wait timeouts when creating suscribers for the
same customer in parallel.

Change-Id: I067102b3dc726e5d12fa859613b548d007ce29ee
mr14.0
Rene Krenn 2 months ago
parent 4f64c07ac5
commit f501fc1dcf

@ -396,7 +396,11 @@ sub prepare_resource {
my ($cid) = @_;
my $contract = $self->get_customer($c, $cid);
NGCP::Panel::Utils::Contract::acquire_contract_rowlocks(
c => $c, schema => $c->model('DB'), contract_id => $contract->id) if $contract;
c => $c,
schema => $c->model('DB'),
contract_id => $contract->id,
skip_locked => ($c->request->header('X-Delay-Commit') ? 0 : 1),
) if $contract;
return $contract;
},
);

Loading…
Cancel
Save