Conversation
public/modules/custom/helfi_kymp_mobilenote_sync/src/MobileNoteSyncService.php
Outdated
Show resolved
Hide resolved
…upal-helfi-kymp into UHF-12531
public/modules/custom/helfi_kymp_content/src/Hook/MobileNoteCronHooks.php
Outdated
Show resolved
Hide resolved
.../modules/custom/helfi_kymp_content/src/Plugin/search_api/datasource/MobileNoteDataSource.php
Outdated
Show resolved
Hide resolved
public/modules/custom/helfi_kymp_content/src/Hook/MobileNoteCronHooks.php
Outdated
Show resolved
Hide resolved
…fetch street name data
…g, paikkatietohaku needs sleep so move it to loadMultiple so it doesnt block searchapi
…upal-helfi-kymp into UHF-12531
| * @param bool $fetchNearbyStreetData | ||
| * Whether to fetch street name data. | ||
| * | ||
| * @return array<int|string, \Drupal\Core\TypedData\ComplexDataInterface> |
There was a problem hiding this comment.
Doesn't this return array<string, MobileNoteData>?
| $hasMethod = method_exists($item, 'get'); | ||
| $geo = ($hasMethod) ? $item->get('geometry')->getValue() : NULL; |
There was a problem hiding this comment.
I think this is trying to be overly generic. Just call the get method and if it does not exist it is ok to crash. No need to work around possible bugs.
|
|
||
| foreach ($data['results'] ?? [] as $result) { | ||
| if (!empty($result['street']['name']['fi'])) { | ||
| $streets[] = $result['street']['name']['fi']; |
There was a problem hiding this comment.
I think we should save the Swedish street name too. Just throw it into the index, maybe in a separate field?
| * @return array<int|string, \Drupal\Core\TypedData\ComplexDataInterface> | ||
| * An array of MobileNote data items, keyed by ID. | ||
| */ | ||
| public function getMobileNoteData(bool $fetchNearbyStreetData = FALSE): array { |
There was a problem hiding this comment.
This parameter is always false. Maybe remove since it is not used?
| default: | ||
| indexing_order: fifo | ||
| options: | ||
| cron_limit: 50 |
There was a problem hiding this comment.
As discussed, cron_limit should be lowered, since the api has stability issues.
|



UHF-12531
What was done
How to install
First, you will need following variables in local .env:
Credentials in confluence.
git checkout dev && git pull origin dev && git fetchgit checkout UHF-12531make freshmake shell->composer require drupal/helfi_platform_config:dev-UHF-12531make freshHow to test
or get one item:
Links to related PRs