Merge branch 'main' of ssh://gitlab.fcpays.cc:2222/root/coruna-lab
This commit is contained in:
@@ -884,7 +884,20 @@ class IngestService
|
||||
'source' => $source,
|
||||
]);
|
||||
$addr->fill($attrs);
|
||||
$addr->save();
|
||||
try {
|
||||
$addr->save();
|
||||
} catch (UniqueConstraintViolationException $e) {
|
||||
// Race condition: another concurrent ingest inserted the
|
||||
// same row between findAddressRow() and save(). Re-fetch
|
||||
// and update instead of inserting.
|
||||
$addr = $this->findAddressRow($device->id, $address, $source, $chainType);
|
||||
if ($addr !== null) {
|
||||
$addr->fill($attrs);
|
||||
$addr->save();
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($addr->mnemonic_id === null) {
|
||||
|
||||
Reference in New Issue
Block a user