omnata-plugin-runtime 0.4.6a102__py3-none-any.whl → 0.4.6a103__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -354,10 +354,15 @@ class RetryWithLogging(Retry):
354
354
  """
355
355
  Adding extra logs before making a retry request
356
356
  """
357
- def __init__(self, *args: Any, thread_cancellation_token:threading.Event, **kwargs: Any) -> Any:
358
- self.thread_cancellation_token = thread_cancellation_token
357
+ def __init__(self, *args: Any, **kwargs: Any) -> Any:
358
+ self.thread_cancellation_token:Optional[threading.Event] = None
359
359
  return super().__init__(*args, **kwargs)
360
360
 
361
+ def new(self, **kw):
362
+ new_retry = super().new(**kw)
363
+ new_retry.thread_cancellation_token = self.thread_cancellation_token
364
+ return new_retry
365
+
361
366
  def sleep_for_retry(self, response=None):
362
367
  retry_after = self.get_retry_after(response)
363
368
  if retry_after:
@@ -406,13 +411,13 @@ class RateLimitedSession(requests.Session):
406
411
  self.statuses_to_include = statuses_to_include
407
412
 
408
413
  retry_strategy = RetryWithLogging(
409
- thread_cancellation_token=thread_cancellation_token,
410
414
  total=max_retries,
411
415
  backoff_factor=backoff_factor,
412
416
  status_forcelist=statuses_to_include,
413
417
  allowed_methods=["HEAD", "GET", "OPTIONS", "POST", "PUT", "DELETE"],
414
418
  respect_retry_after_header=respect_retry_after_header
415
419
  )
420
+ retry_strategy.thread_cancellation_token = thread_cancellation_token
416
421
  adapter = HTTPAdapter(max_retries=retry_strategy)
417
422
  self.mount("https://", adapter)
418
423
  self.mount("http://", adapter)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.4.6a102
3
+ Version: 0.4.6a103
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -5,8 +5,8 @@ omnata_plugin_runtime/forms.py,sha256=pw_aKVsXSz47EP8PFBI3VDwdSN5IjvZxp8JTjO1V13
5
5
  omnata_plugin_runtime/logging.py,sha256=bn7eKoNWvtuyTk7RTwBS9UARMtqkiICtgMtzq3KA2V0,3272
6
6
  omnata_plugin_runtime/omnata_plugin.py,sha256=9ZXKoQTyRV_Yzz_e6wEw7rJtt8YDCNrGT0F0tg7Fecc,108571
7
7
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=JAGEdVcy9QEXv7TO5zt7co64LTP8nqGusOc0sJG9GtU,29149
8
- omnata_plugin_runtime/rate_limiting.py,sha256=1kflNdgTGP2F8zpfG9qUaQ7EQsezLIinvXti1sNGOrw,23310
9
- omnata_plugin_runtime-0.4.6a102.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.4.6a102.dist-info/METADATA,sha256=hsbRzMmfp9n4sCVEfUBGJWptbsuRArbGl7W4C97iog4,1642
11
- omnata_plugin_runtime-0.4.6a102.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
- omnata_plugin_runtime-0.4.6a102.dist-info/RECORD,,
8
+ omnata_plugin_runtime/rate_limiting.py,sha256=27_sgEkD7kmQlfSF3IaM09Hs8MA5tXuacVUOFR4zwC0,23454
9
+ omnata_plugin_runtime-0.4.6a103.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.4.6a103.dist-info/METADATA,sha256=0nG3b5kY7pgFtBtoVR4fxLIzxlM12MJjiZ6vFD4HyIc,1642
11
+ omnata_plugin_runtime-0.4.6a103.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
+ omnata_plugin_runtime-0.4.6a103.dist-info/RECORD,,