From 6cae153569a7174ad7ba92af4664e0804a185f2e Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 22 Aug 2011 10:44:31 -0700 Subject: [PATCH] Allow CommitTask daemon to recover from deleted repositories Summary: If a user partially discovers a repository and then deletes it, the timeline will have events from the old repository which this daemon won't be able to parse. Test Plan: @ajtrichards, can you apply this locally and restart your daemons (##phd stop##, then relaunch them) and let me know if it fixes the issue? Reviewers: ajtrichards, jungejason, tuomaspelkonen, aran Reviewed By: ajtrichards CC: aran, epriestley, ajtrichards Differential Revision: 845 --- .../committask/PhabricatorRepositoryCommitTaskDaemon.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/repository/daemon/committask/PhabricatorRepositoryCommitTaskDaemon.php b/src/applications/repository/daemon/committask/PhabricatorRepositoryCommitTaskDaemon.php index 79b977c197..751f435446 100644 --- a/src/applications/repository/daemon/committask/PhabricatorRepositoryCommitTaskDaemon.php +++ b/src/applications/repository/daemon/committask/PhabricatorRepositoryCommitTaskDaemon.php @@ -40,6 +40,12 @@ class PhabricatorRepositoryCommitTaskDaemon // TODO: Cache these. $repository = id(new PhabricatorRepository())->load( $commit->getRepositoryID()); + if (!$repository) { + // TODO: As above, although this almost certainly means the user just + // deleted the repository and we're correct to ignore the event in + // the timeline. + continue; + } $vcs = $repository->getVersionControlSystem(); switch ($vcs) {