From d7940cf9470ee8377cf6484f4a20869c62d48685 Mon Sep 17 00:00:00 2001 From: winter Date: Tue, 14 Jan 2025 17:04:57 +0000 Subject: don't retry pushing to an instance with no push endpoint --- Digitigrade/Job/PushObject.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Digitigrade/Job') 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 @@ 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 -- cgit v1.3