Initialize files needed for the exporter.
()
| 528 | |
| 529 | |
| 530 | def 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 | |
| 550 | async def main() -> None: |
no outgoing calls
no test coverage detected
searching dependent graphs…