Skip to content

Commit 7bcf17c

Browse files
committed
fix: after review
1 parent e108745 commit 7bcf17c

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/job-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ jobs:
133133
env:
134134
PGSQL_DATABASE_URL: pgsql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?serverVersion=18&charset=utf8
135135
MYSQL_DATABASE_URL: mysql://mysql:mysql@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/mysql
136+
ELASTICSEARCH_URL: http://127.0.0.1:${{ job.services.elasticsearch.ports['9200'] }}
136137
SQLITE_DATABASE_URL: "sqlite:///:memory:"
137138
AZURITE_HOST: "localhost"
138139
AZURITE_BLOB_PORT: "10000"
@@ -158,7 +159,6 @@ jobs:
158159
env:
159160
PGSQL_DATABASE_URL: pgsql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres?serverVersion=18&charset=utf8
160161
MYSQL_DATABASE_URL: mysql://mysql:mysql@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/mysql
161-
ELASTICSEARCH_URL: http://127.0.0.1:${{ job.services.elasticsearch.ports['9200'] }}
162162
SQLITE_DATABASE_URL: "sqlite:///:memory:"
163163
AZURITE_HOST: "localhost"
164164
AZURITE_BLOB_PORT: "10000"

src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/SealExtractor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Flow\ETL\Rows;
1414
use Generator;
1515

16-
use function count;
1716
use function Flow\ETL\DSL\array_to_rows;
1817

1918
final class SealExtractor implements Extractor
@@ -49,12 +48,14 @@ public function extract(FlowContext $context): Generator
4948
$search->offset($offset);
5049

5150
$documents = [];
51+
$count = 0;
5252

5353
foreach ($search->getResult() as $document) {
5454
$documents[] = $document;
55+
$count++;
5556
}
5657

57-
if ($documents === []) {
58+
if ($count === 0) {
5859
return;
5960
}
6061

@@ -64,7 +65,7 @@ public function extract(FlowContext $context): Generator
6465
return;
6566
}
6667

67-
if (count($documents) < $this->pageSize) {
68+
if ($count < $this->pageSize) {
6869
return;
6970
}
7071

src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Context/SealContext.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use CmsIg\Seal\EngineInterface;
1111
use CmsIg\Seal\Schema\Schema;
1212

13-
use function array_keys;
14-
1513
final class SealContext
1614
{
1715
/**
@@ -42,7 +40,7 @@ public function engine(Schema $schema): EngineInterface
4240
{
4341
$engine = new Engine($this->adapter, $schema);
4442

45-
foreach (array_keys($schema->indexes) as $index) {
43+
foreach ($schema->indexes as $index => $_value) {
4644
if ($engine->existIndex($index)) {
4745
$engine->dropIndex($index, ['return_slow_promise_result' => true])?->wait();
4846
}

0 commit comments

Comments
 (0)