diff options
| author | winter | 2025-01-14 17:04:57 +0000 |
|---|---|---|
| committer | winter | 2025-01-14 17:04:57 +0000 |
| commit | d7940cf9470ee8377cf6484f4a20869c62d48685 (patch) | |
| tree | 7d6848093e1111636b380e894fda89562f9278d8 /Digitigrade/Job/PushObject.php | |
| parent | 3ce58a33945fc858ac4f8b2b8471dff0cf294863 (diff) | |
don't retry pushing to an instance with no push endpoint
Diffstat (limited to 'Digitigrade/Job/PushObject.php')
| -rw-r--r-- | Digitigrade/Job/PushObject.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Digitigrade/Job/PushObject.php b/Digitigrade/Job/PushObject.php index f5f1430..ee5841e 100644 --- a/Digitigrade/Job/PushObject.php +++ b/Digitigrade/Job/PushObject.php @@ -1,6 +1,7 @@ <?php namespace Digitigrade\Job; +use Digitigrade\Exception\EndpointMissingException; use Digitigrade\Job; use Digitigrade\Logger; use Digitigrade\Model\Instance; @@ -24,7 +25,14 @@ class PushObject extends Job { $object = $this->objectType::find($this->objectId); assert($object instanceof PushableModel); - Logger::getInstance()->info("pushing object $object->uri to server $instance->domain"); - $instance->pushObject($object); + $log = Logger::getInstance(); + $log->info("pushing object $object->uri to server $instance->domain"); + try { + $instance->pushObject($object); + } catch (EndpointMissingException $e) { + $log->warning("can't push to $instance->domain because it has no push endpoint. giving up"); + // and don't throw again here because we want it to look successful and not be retried + // reasoning: i think it's unlikely for an instance with no endpoint to suddenly acquire one + } } }
\ No newline at end of file |
