]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16406 - trying to mitigate box.net problems slightly.
authormjollnir_ <mjollnir_>
Wed, 10 Sep 2008 12:04:30 +0000 (12:04 +0000)
committermjollnir_ <mjollnir_>
Wed, 10 Sep 2008 12:04:30 +0000 (12:04 +0000)
portfolio/type/boxnet/lib.php

index d7c8843a9b017c0fe8e3ce978b79822360d37028..b4cf4e52356f6eaea57ac8528ccf29eb996932ac 100644 (file)
@@ -227,7 +227,13 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base {
         }
         while (true) {
             if (!array_key_exists('file_name', $this->accounttree) || !in_array($newname, $this->accounttree['file_name'])) {
-                return $this->boxclient->renameFile($fileid, $newname);
+                for ($i = 0; $i < 2; $i++) {
+                    if ($this->boxclient->renameFile($fileid, $newname)) {
+                        return true;
+                    }
+                }
+                debugging("tried three times to rename file and failed");
+                return false;
             }
             $newname = $prefix . '(' . $count . ')' . $suffix;
             $count++;