Skip to content

Commit

Permalink
tagging: ignore if cannot get lock
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton committed Sep 10, 2024
1 parent 3002355 commit a035f35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/local/store/object_file_system.php
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,9 @@ private function update_object(array $result): array {
* External client must support tagging.
*
* @param string $contenthash file to sync tags for
* @return bool true if set tags, false if could not get lock.
*/
public function push_object_tags(string $contenthash) {
public function push_object_tags(string $contenthash): bool {
if (!$this->get_external_client()->supports_object_tagging()) {
throw new coding_exception("Cannot sync tags, external client does not support tagging.");
}
Expand All @@ -1199,7 +1200,7 @@ public function push_object_tags(string $contenthash) {

// No lock - just skip it.
if (!$lock) {
throw new coding_exception("Could not get object lock");
return false;
}

try {
Expand Down Expand Up @@ -1227,6 +1228,7 @@ public function push_object_tags(string $contenthash) {
throw $e;
}
$lock->release();
return true;
}

/**
Expand Down

0 comments on commit a035f35

Please sign in to comment.