Closed bretto36 closed 10 months ago
Thanks
@bretto36 Can you please write the complete code on how to do it. The code You have provided above has some missing braces
@usmanpakistan
'api_init' => ['\App\Services\ShopifyConfig', 'options'],
<?php
namespace App\Services;
class ShopifyConfig
{
public static function options(\Osiset\BasicShopifyAPI\Options $opts)
{
$ts = config('shopify-app.api_time_store');
$ls = config('shopify-app.api_limit_store');
$sd = config('shopify-app.api_deferrer');
// Custom Guzzle options
$opts->setGuzzleOptions(['timeout' => 30]);
return new \Osiset\BasicShopifyAPI\BasicShopifyAPI(
$opts,
new $ts(),
new $ls(),
new $sd()
);
}
}
Just posting here to help others who have issues with timeouts and who are using php artisan optimize
YOu can specify config but you need to use a callable if you want to run artisan optimize at the same time.
'api_init' => ['\App\Services\ShopifyConfig', 'options'],
<?php
namespace App\Services;
class ShopifyConfig { public static function options(\Osiset\BasicShopifyAPI\Options $opts) { $ts = config('shopify-app.api_time_store'); $ls = config('shopify-app.api_limit_store'); $sd = config('shopify-app.api_deferrer');
}