omnata-plugin-runtime 0.2.24__tar.gz → 0.2.26__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.2.24
3
+ Version: 0.2.26
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.2.24"
3
+ version = "0.2.26"
4
4
  description = "Classes and common runtime components for building and running Omnata Plugins"
5
5
  authors = ["James Weakley <james.weakley@omnata.com>"]
6
6
  readme = "README.md"
@@ -98,6 +98,9 @@ class PluginEntrypoint:
98
98
  )
99
99
  api_limits = list(all_api_limits_by_category.values())
100
100
  return_dict = {}
101
+ logger.info(
102
+ f"Rate limits state: {json.dumps(request.rate_limits_state, default=pydantic.json.pydantic_encoder)}"
103
+ )
101
104
  (rate_limit_state_all, rate_limit_state_this_branch) = RateLimitState.collapse(request.rate_limits_state,request.sync_id, request.sync_branch_name)
102
105
  # if any endpoint categories have no state, give them an empty state
103
106
  for api_limit in api_limits:
@@ -109,9 +112,6 @@ class PluginEntrypoint:
109
112
  rate_limit_state_this_branch[api_limit.endpoint_category] = RateLimitState(
110
113
  wait_until=None, previous_request_timestamps=None
111
114
  )
112
- logger.info(
113
- f"Rate limits state: {json.dumps(request.rate_limits_state, default=pydantic.json.pydantic_encoder)}"
114
- )
115
115
 
116
116
  if request.sync_direction == "outbound":
117
117
  parameters = OutboundSyncConfigurationParameters(
@@ -133,7 +133,7 @@ class PluginEntrypoint:
133
133
  results_schema_name=request.results_schema_name,
134
134
  results_table_name=request.results_table_name,
135
135
  plugin_instance=self._plugin_instance,
136
- api_limits=request.api_limit_overrides,
136
+ api_limits=api_limits,
137
137
  rate_limit_state_all=rate_limit_state_all,
138
138
  rate_limit_state_this_sync_and_branch=rate_limit_state_this_branch,
139
139
  run_deadline=datetime.datetime.now() + datetime.timedelta(hours=4),
@@ -168,7 +168,7 @@ class PluginEntrypoint:
168
168
  results_schema_name=request.results_schema_name,
169
169
  results_table_name=request.results_table_name,
170
170
  plugin_instance=self._plugin_instance,
171
- api_limits=request.api_limit_overrides,
171
+ api_limits=api_limits,
172
172
  rate_limit_state_all=rate_limit_state_all,
173
173
  rate_limit_state_this_sync_and_branch=rate_limit_state_this_branch,
174
174
  run_deadline=datetime.datetime.now() + datetime.timedelta(hours=4),
@@ -173,7 +173,7 @@ class RateLimitState(SubscriptableBaseModel):
173
173
  """
174
174
  if other.wait_until is not None and (self.wait_until is None or other.wait_until > self.wait_until):
175
175
  self.wait_until = other.wait_until
176
- if len(other.previous_request_timestamps) > 0:
176
+ if other.previous_request_timestamps is not None and len(other.previous_request_timestamps) > 0:
177
177
  self.previous_request_timestamps.extend(other.previous_request_timestamps)
178
178
  self.previous_request_timestamps.sort(reverse=True) # they should be sorted newest to oldest
179
179