MCPcopy
hub / github.com/smittix/intercept / run

Method run

intercept_agent.py:3757–3779  ·  view source on GitHub ↗

Main push loop.

(self)

Source from the content-addressed store, hash-verified

3755 self.stop_event = threading.Event()
3756
3757 def run(self):
3758 """Main push loop."""
3759 logger.info(f"Data push loop started (interval: {self.interval}s)")
3760
3761 while not self.stop_event.is_set():
3762 if push_client and push_client.running:
3763 # Push data for all running modes
3764 for mode in list(mode_manager.running_modes.keys()):
3765 try:
3766 data = mode_manager.get_mode_data(mode)
3767 if data.get('data'): # Only push if there's data
3768 push_client.enqueue(
3769 scan_type=mode,
3770 payload=data,
3771 interface=None
3772 )
3773 except Exception as e:
3774 logger.warning(f"Failed to push {mode} data: {e}")
3775
3776 # Wait for next interval
3777 self.stop_event.wait(self.interval)
3778
3779 logger.info("Data push loop stopped")
3780
3781 def stop(self):
3782 """Stop the push loop."""

Callers 4

_detect_interfacesMethod · 0.45
toggle_monitor_modeMethod · 0.45
_detect_acarsdec_forkMethod · 0.45

Calls 5

keysMethod · 0.80
getMethod · 0.80
waitMethod · 0.80
get_mode_dataMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected