mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 10:41:08 +01:00
Log and continue when trying to destroy edges with no edge definition
Summary: Fixes T11201. Test Plan: Created bogus edges like this: ``` INSERT INTO edge (src, type, dst, dateCreated, seq) values ('PHID-TASK-vnddativbialb5p6ymis', 999999, 'quack', UNIX_TIMESTAMP(), 1); ``` Then ran `bin/remove destroy` on the relevant object. Before the patch, destruction halted after hittin the bad edge. After the patch, a warning is emitted but destruction continues. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11201 Differential Revision: https://secure.phabricator.com/D16171
This commit is contained in:
parent
72588d2eaa
commit
a2cb5e1347
1 changed files with 11 additions and 1 deletions
|
@ -28,10 +28,20 @@ final class PhabricatorEdgesDestructionEngineExtension
|
|||
foreach ($edges as $type => $type_edges) {
|
||||
foreach ($type_edges as $src => $src_edges) {
|
||||
foreach ($src_edges as $dst => $edge) {
|
||||
$editor->removeEdge($edge['src'], $edge['type'], $edge['dst']);
|
||||
try {
|
||||
$editor->removeEdge($edge['src'], $edge['type'], $edge['dst']);
|
||||
} catch (Exception $ex) {
|
||||
// We can run into an exception while removing the edge if the
|
||||
// edge type no longer exists. This prevents us from figuring out
|
||||
// if there's an inverse type. Just ignore any errors here and
|
||||
// continue, since the best we can do is clean up all the edges
|
||||
// we still have information about. See T11201.
|
||||
phlog($ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$editor->save();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue