1ef966f339c7081063ca998ea8fe0beb123b43e2 — Amolith 5 months ago a8b9ebe
Eliminate a registration race condition

Check whether we've actually deleted anything before proceeding with
registration; if we have not deleted anything, it means another customer
has registered that number before this one could.

Signed-off-by: Amolith <amolith@secluded.site>
1 files changed, 1 insertions(+), 0 deletions(-)

M lib/tel_selections.rb
M lib/tel_selections.rb => lib/tel_selections.rb +1 -0
@@ 317,6 317,7 @@ class TelSelections
						tel, customer.customer_id, @bandwidth_account_id
					db.exec_defer("DELETE FROM tel_inventory WHERE tel = $1", [tel])
						.then { |r| raise unless r.cmd_tuples.positive? }