mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-25 21:56:11 +01:00
TASK: Allow sub indexer to exchange limit
As long as it's not configurable, allow concrete implementations to exchange. Necessary for one customer at the moment.
This commit is contained in:
parent
c58e13cdf6
commit
b832a6e6b3
1 changed files with 12 additions and 2 deletions
|
@ -83,8 +83,7 @@ abstract class AbstractIndexer implements IndexerInterface
|
|||
protected function getRecordGenerator()
|
||||
{
|
||||
$offset = 0;
|
||||
// TODO: Make configurable.
|
||||
$limit = 50;
|
||||
$limit = $this->getLimit();
|
||||
|
||||
while (($records = $this->getRecords($offset, $limit)) !== []) {
|
||||
yield $records;
|
||||
|
@ -92,6 +91,17 @@ abstract class AbstractIndexer implements IndexerInterface
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the limit to use to fetch records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function getLimit()
|
||||
{
|
||||
// TODO: Make configurable.
|
||||
return 50;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $offset
|
||||
* @param int $limit
|
||||
|
|
Loading…
Reference in a new issue