Skip to content

Commit

Permalink
Merge pull request #1431 from keboola/zajca-ct-1894
Browse files Browse the repository at this point in the history
CT-1894 add retry on BQ isTableExists
  • Loading branch information
zajca authored Dec 11, 2024
2 parents edb2966 + 8b5ef49 commit 556f742
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Keboola\TableBackendUtils\Table\Bigquery\BigqueryTableReflection;
use Keboola\TableBackendUtils\View\ViewReflectionInterface;
use PDO;
use Retry\RetryProxy;

class BigqueryWorkspaceBackend implements WorkspaceBackend
{
Expand Down Expand Up @@ -218,7 +219,11 @@ protected function isTableExists(string $schema, string $table): bool
$dataset = $this->bqClient->dataset($schema);
$table = $dataset->table($table);

return $table->exists();
$exists = (new RetryProxy())->call(function () use ($table) {
return $table->exists();
});
assert(is_bool($exists));
return $exists;
}

public function dropViewIfExists(string $table): void
Expand Down

0 comments on commit 556f742

Please sign in to comment.