Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhanjun authored and github-actions[bot] committed Dec 27, 2023
1 parent 032b3ee commit a1ce785
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/OpenAi.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected function polling($tokens)
$token = $explode[0] ?? '';
if (count($explode) > 1) {
$path = storage_path('app/openai_token/' . md5($tokens));

try {
$token_number = file_get_contents($path);
} catch (\Exception $e) {
Expand All @@ -100,6 +101,7 @@ protected function polling($tokens)
file_put_contents($path, ($token_number + 1));
$token = $token_number % count($explode) == 0 ? $explode[0] : $explode[1];
}

return $token;
}

Expand Down

0 comments on commit a1ce785

Please sign in to comment.