Main entry point for the exporter
()
| 548 | |
| 549 | |
| 550 | async def main() -> None: |
| 551 | """Main entry point for the exporter""" |
| 552 | # Initialize files |
| 553 | init_files() |
| 554 | |
| 555 | try: |
| 556 | row_count = await count_session_rows() |
| 557 | total_pages = row_count // BATCH_ROW_COUNT |
| 558 | print(f"Total pages: {total_pages}".center(80, "=")) |
| 559 | |
| 560 | for page_number in range(0, total_pages): |
| 561 | offset, limit = page_number * BATCH_ROW_COUNT, BATCH_ROW_COUNT |
| 562 | await process_page(offset, limit) |
| 563 | print(f"Processed page {page_number}".center(80, "=")) |
| 564 | if MAX_PAGES is not None and MAX_PAGES >= page_number: |
| 565 | break |
| 566 | finally: |
| 567 | if _last_session_file: |
| 568 | _last_session_file.close() |
| 569 | await close_supabase_pool() |
| 570 | |
| 571 | |
| 572 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…