From ddced3e90cc7d8b02b7372446c0f85212896fd1b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 19 Oct 2022 09:51:51 -0500 Subject: [PATCH] Allow configuring timeout for WooCommerce API at least when importing data from Woo --- rattail_woocommerce/importing/woocommerce.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rattail_woocommerce/importing/woocommerce.py b/rattail_woocommerce/importing/woocommerce.py index b5bdd62..81e26bb 100644 --- a/rattail_woocommerce/importing/woocommerce.py +++ b/rattail_woocommerce/importing/woocommerce.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2021 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -61,6 +61,11 @@ class FromWooCommerce(importing.Importer): 'consumer_secret': self.config.require('woocommerce', 'api_consumer_secret'), 'version': 'wc/v3', } + + timeout = self.config.getint('woocommerce', 'api_timeout') + if timeout: + kwargs['timeout'] = timeout + self.api = WooAPI(**kwargs) def get_woocommerce_products(self):