Attempt to catch DB errors and abort the transaction, so that the queue continues to run.
This commit is contained in:
parent
e7ebaa85cb
commit
702a4e4f37
@ -343,7 +343,14 @@ class NodelistImport implements ShouldQueue
|
||||
}
|
||||
|
||||
// Save the system record
|
||||
$so->save();
|
||||
try {
|
||||
$so->save();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:Error with line [%s] (%s)',self::LOGKEY,$line,$e->getMessage()),['fields'=>$fields]);
|
||||
DB::rollBack();
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
|
||||
// If our zone didnt exist, we'll create it with this system
|
||||
if (! $zo->exists) {
|
||||
@ -365,6 +372,8 @@ class NodelistImport implements ShouldQueue
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:Error with line [%s] (%s)',self::LOGKEY,$line,$e->getMessage()),['fields'=>$fields]);
|
||||
DB::rollBack();
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
|
||||
if (! ($c % 100)) {
|
||||
|
Loading…
Reference in New Issue
Block a user