Skip to content

Commit d0adc4a

Browse files
scottnerdnganbreadsol-loup
authored
Skip CatalogSetup logging when not authenticated (#503)
* Skip logging whe not authenticated * Send store id with exception logging * Removed local logging call * Remove whitespace --------- Co-authored-by: Scott Ngan <[email protected]> Co-authored-by: Paul Kang <[email protected]>
1 parent 17bd627 commit d0adc4a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/code/Meta/Catalog/Cron/LogCatalogSetup.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ public function __construct(
8686
public function execute()
8787
{
8888
foreach ($this->systemConfig->getAllFBEInstalledStores() as $store) {
89+
$storeId = $store->getId();
8990
try {
90-
$storeId = $store->getId();
91+
$accessToken = $this->systemConfig->getAccessToken($storeId);
92+
if (!$accessToken) {
93+
continue;
94+
}
95+
9196
$this->graphAPIAdapter->persistLogToMeta([
9297
'event' => 'log_catalog_setup_data',
9398
'event_type' => 'log_catalog_setup',
@@ -108,7 +113,7 @@ public function execute()
108113
]);
109114
} catch (\Exception $e) {
110115
$this->fbeHelper->logExceptionImmediatelyToMeta($e, [
111-
'catalog_id' => $this->systemConfig->getCatalogId(),
116+
'store_id' => $storeId,
112117
'event' => 'log_catalog_setup_cron_exception',
113118
'event_type' => 'log_catalog_setup'
114119
]);

0 commit comments

Comments
 (0)