diff options
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 |
