aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorwinter2025-05-08 23:48:48 +0100
committerwinter2025-05-08 23:48:48 +0100
commite3c7df69dbb62c80ec58bf75cfc55f498f04219a (patch)
tree6964b7b0998d98f50250f983533c274f8956b52c
parent09b3847233adbdfbd7496d81d2a2f93fae0d0ee4 (diff)
dont keep trying to push when it won't work
-rw-r--r--Digitigrade/Job/PushObject.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/Digitigrade/Job/PushObject.php b/Digitigrade/Job/PushObject.php
index 1f3bcd9..82db4d3 100644
--- a/Digitigrade/Job/PushObject.php
+++ b/Digitigrade/Job/PushObject.php
@@ -29,9 +29,11 @@ class PushObject extends Job {
$log = Logger::getInstance();
$log->info("pushing object $object->uri to server $instance->domain");
- $successful = false;
try {
$successful = $instance->pushObject($object);
+ if (!$successful) {
+ throw new \RuntimeException("failed to push to $instance->domain");
+ }
} 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
@@ -44,8 +46,5 @@ class PushObject extends Job {
$log->warning("can't push to $instance->domain because a policy rejected it. giving up");
// and don't throw again, pretty much same reasoning as above
}
- if (!$successful) {
- throw new \RuntimeException("failed to push to $instance->domain");
- }
}
} \ No newline at end of file