omnata-plugin-runtime 0.11.0a306__py3-none-any.whl → 0.11.0a307__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.
@@ -1205,31 +1205,30 @@ class InboundSyncRequest(SyncRequest):
1205
1205
  """
1206
1206
  Sends a message to the plugin with the current progress of the sync run, if it has changed since last time.
1207
1207
  """
1208
- if self._apply_results is not None:
1209
- with self._apply_results_lock:
1210
- new_progress_update = PluginMessageStreamProgressUpdate(
1211
- stream_total_counts=self._stream_record_counts,
1212
- # records could have been marked as completed, but still have results to apply
1213
- completed_streams=[s for s in self._completed_streams if s not in self._apply_results or self._apply_results[s] is None],
1214
- stream_errors=self._omnata_log_handler.stream_global_errors,
1215
- total_records_estimate=self._total_records_estimate
1216
- )
1217
- if self._last_stream_progress_update is None or new_progress_update != self._last_stream_progress_update:
1218
- result = self._plugin_message(
1219
- message=new_progress_update,
1220
- ignore_errors=ignore_errors
1208
+ with self._apply_results_lock:
1209
+ new_progress_update = PluginMessageStreamProgressUpdate(
1210
+ stream_total_counts=self._stream_record_counts,
1211
+ # records could have been marked as completed, but still have results to apply
1212
+ completed_streams=[s for s in self._completed_streams if s not in self._apply_results or self._apply_results[s] is None],
1213
+ stream_errors=self._omnata_log_handler.stream_global_errors,
1214
+ total_records_estimate=self._total_records_estimate
1215
+ )
1216
+ if self._last_stream_progress_update is None or new_progress_update != self._last_stream_progress_update:
1217
+ result = self._plugin_message(
1218
+ message=new_progress_update,
1219
+ ignore_errors=ignore_errors
1220
+ )
1221
+ if result is None:
1222
+ return False
1223
+ self._last_stream_progress_update = new_progress_update
1224
+ else:
1225
+ completed_streams_awaiting_results_upload = [
1226
+ s for s in self._completed_streams if s in self._apply_results and self._apply_results[s] is not None
1227
+ ]
1228
+ for completed_stream_awaiting_results_upload in completed_streams_awaiting_results_upload:
1229
+ logger.debug(
1230
+ f"Stream {completed_stream_awaiting_results_upload} is marked as completed but awaiting upload of {len(self._apply_results[completed_stream_awaiting_results_upload])} results"
1221
1231
  )
1222
- if result is None:
1223
- return False
1224
- self._last_stream_progress_update = new_progress_update
1225
- else:
1226
- completed_streams_awaiting_results_upload = [
1227
- s for s in self._completed_streams if s in self._apply_results and self._apply_results[s] is not None
1228
- ]
1229
- for completed_stream_awaiting_results_upload in completed_streams_awaiting_results_upload:
1230
- logger.debug(
1231
- f"Stream {completed_stream_awaiting_results_upload} is marked as completed but awaiting upload of {len(self._apply_results[completed_stream_awaiting_results_upload])} results"
1232
- )
1233
1232
  return True
1234
1233
 
1235
1234
  def apply_cancellation(self):
@@ -1355,6 +1354,7 @@ class InboundSyncRequest(SyncRequest):
1355
1354
  Marks a stream as completed, this is called automatically per stream when using @managed_inbound_processing.
1356
1355
  If @managed_inbound_processing is not used, call this whenever a stream has finished recieving records.
1357
1356
  """
1357
+ logger.debug(f"Marking stream {stream_name} as completed locally")
1358
1358
  self._completed_streams.append(stream_name)
1359
1359
  # dedup just in case it's called twice
1360
1360
  self._completed_streams = list(set(self._completed_streams))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.11.0a306
3
+ Version: 0.11.0a307
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
@@ -4,10 +4,10 @@ omnata_plugin_runtime/configuration.py,sha256=SffokJfgvy6V3kUsoEjXcK3GdNgHo6U3mg
4
4
  omnata_plugin_runtime/forms.py,sha256=Lrbr3otsFDrvHWJw7v-slsW4PvEHJ6BG1Yl8oaJfiDo,20529
5
5
  omnata_plugin_runtime/json_schema.py,sha256=xI5YeoxdV1e4fYLUYB-1ZGXZrLAIrSnKj91189wf8cQ,49943
6
6
  omnata_plugin_runtime/logging.py,sha256=WBuZt8lF9E5oFWM4KYQbE8dDJ_HctJ1pN3BHwU6rcd0,4461
7
- omnata_plugin_runtime/omnata_plugin.py,sha256=k9q2KvaX6w3BIXSc06FH-_s9Ub6VCh7G4a8IbPceNVE,140229
7
+ omnata_plugin_runtime/omnata_plugin.py,sha256=-0W7wrNEjdGCmcXlJmPeEA5lki-y57aLBPlrSjbxSq0,140164
8
8
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=_1pDLov3iQorGmfcae8Sw2bVjxw1vYeowBaKKNzRclQ,32629
9
9
  omnata_plugin_runtime/rate_limiting.py,sha256=qpr5esU4Ks8hMzuMpSR3gLFdor2ZUXYWCjmsQH_K6lQ,25882
10
- omnata_plugin_runtime-0.11.0a306.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
- omnata_plugin_runtime-0.11.0a306.dist-info/METADATA,sha256=RO--GdVD2IJdmXI_hFikvE0j807cGfZqTOKCcIFiiaM,2211
12
- omnata_plugin_runtime-0.11.0a306.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
13
- omnata_plugin_runtime-0.11.0a306.dist-info/RECORD,,
10
+ omnata_plugin_runtime-0.11.0a307.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
+ omnata_plugin_runtime-0.11.0a307.dist-info/METADATA,sha256=q3KVLVi76uaL57QyzlNiUK_NGgvSrBboFHR-_vjxdFU,2211
12
+ omnata_plugin_runtime-0.11.0a307.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
13
+ omnata_plugin_runtime-0.11.0a307.dist-info/RECORD,,