File tree Expand file tree Collapse file tree
src/adapter/etl-adapter-seal
src/Flow/ETL/Adapter/Seal
tests/Flow/ETL/Adapter/Seal/Tests/Context Expand file tree Collapse file tree Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff line change 1313use Flow \ETL \Rows ;
1414use Generator ;
1515
16- use function count ;
1716use function Flow \ETL \DSL \array_to_rows ;
1817
1918final 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
Original file line number Diff line number Diff line change 1010use CmsIg \Seal \EngineInterface ;
1111use CmsIg \Seal \Schema \Schema ;
1212
13- use function array_keys ;
14-
1513final 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 }
You can’t perform that action at this time.
0 commit comments