Browse Source

mmnode-ticker: support `--http-timeout` option

The MMGen Project 2 months ago
parent
commit
b9957f9182
2 changed files with 5 additions and 1 deletions
  1. 4 0
      mmgen_node_tools/Ticker.py
  2. 1 1
      mmgen_node_tools/data/version

+ 4 - 0
mmgen_node_tools/Ticker.py

@@ -75,6 +75,7 @@ class DataSource:
 				['--compressed'], # adds 'Accept-Encoding: gzip'
 				['--proxy', cfg.proxy, isinstance(cfg.proxy, str)],
 				['--silent', not cfg.verbose],
+				['--connect-timeout', str(gcfg.http_timeout), gcfg.http_timeout],
 				[self.api_url])
 
 			if gcfg.testing:
@@ -290,6 +291,9 @@ class DataSource:
 			if gcfg.test_suite:
 				kwargs.update({'timeout': 1, 'retry': 0})
 
+			if gcfg.http_timeout:
+				kwargs.update({'timeout': gcfg.http_timeout})
+
 			if gcfg.testing:
 				Msg('\nyahooquery.Ticker(\n  {},\n  {}\n)'.format(
 					self.symbols,

+ 1 - 1
mmgen_node_tools/data/version

@@ -1 +1 @@
-3.6.dev1
+3.6.dev2