MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / init_files

Function init_files

app/api/agentops/exporter/processor.py:530–547  ·  view source on GitHub ↗

Initialize files needed for the exporter.

()

Source from the content-addressed store, hash-verified

528
529
530def init_files():
531 """Initialize files needed for the exporter."""
532 global _last_session_file, LAST_SESSION_ID
533
534 # Initialize dropped records file
535 if not os.path.exists(DROPPED_RECORDS_FILENAME):
536 with open(DROPPED_RECORDS_FILENAME, 'w') as f:
537 f.write("table,id,exception\n")
538
539 # Initialize last session ID file
540 if not os.path.exists(LAST_SESSION_ID_FILENAME):
541 from pathlib import Path
542
543 Path(LAST_SESSION_ID_FILENAME).touch()
544
545 # Open the last session ID file
546 _last_session_file = open(LAST_SESSION_ID_FILENAME, 'r+')
547 LAST_SESSION_ID = _last_session_file.read().strip()
548
549
550async def main() -> None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…