]> _ Git - cubist_azuretts.git/commitdiff
#8036 master
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 Mar 2026 14:58:23 +0000 (15:58 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 Mar 2026 14:58:23 +0000 (15:58 +0100)
src/Api.php

index d7e308ecd346e2bb75c1e178c91028fc843cf616..6bba3a657a91e49ac9a95d731b180c0da696470c 100644 (file)
@@ -38,7 +38,9 @@ class Api
 
     public function __construct($key, $region = 'francecentral')
     {
-        $this->key = $key;
+        $key = explode(', ', $key);
+        shuffle($key);
+        $this->key = $key[0];
         $this->region = $region;
         $this->client = new Client();
     }
@@ -81,7 +83,11 @@ class Api
             Cache::forget($cacheKey);
         }
         return Cache::remember($cacheKey, 86400, function () use ($raw) {
-            return $this->_listVoices($raw);
+            try {
+                return $this->_listVoices($raw);
+            } catch (\Exception $e) {
+                Log::error($e);
+            }
         });
     }