MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __init__

Method __init__

actions/connector_utils.py:136–149  ·  view source on GitHub ↗

Initialize the timestamp tracker. Args: action_name: Name of the action (e.g., 'lynis_pentest') datadir: Data directory for storing tracking files interval_hours: Minimum hours between executions

(self, action_name, datadir, interval_hours=24)

Source from the content-addressed store, hash-verified

134 """Helper class to track action timestamps and enforce minimum intervals."""
135
136 def __init__(self, action_name, datadir, interval_hours=24):
137 """
138 Initialize the timestamp tracker.
139
140 Args:
141 action_name: Name of the action (e.g., 'lynis_pentest')
142 datadir: Data directory for storing tracking files
143 interval_hours: Minimum hours between executions
144 """
145 self.action_name = action_name
146 self.interval_hours = interval_hours
147 self.db_file = os.path.join(datadir, f'{action_name}_timestamps.json')
148 self.timestamps = {}
149 self._load_db()
150
151 def _load_db(self):
152 """Load the database of timestamps."""

Callers

nothing calls this directly

Calls 1

_load_dbMethod · 0.95

Tested by

no test coverage detected