mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-11 00:32:38 +02:00
chore: linting
This commit is contained in:
parent
050581ba6a
commit
a3a5b13f48
17 changed files with 104 additions and 69 deletions
|
|
@ -389,10 +389,12 @@ async def index_airtable_records(
|
|||
logger.info(
|
||||
f"Successfully indexed new Airtable record {summary_content}"
|
||||
)
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Airtable records processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Airtable records processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
@ -414,7 +416,9 @@ async def index_airtable_records(
|
|||
)
|
||||
|
||||
# Final commit for any remaining documents not yet committed in batches
|
||||
logger.info(f"Final commit: Total {documents_indexed} Airtable records processed")
|
||||
logger.info(
|
||||
f"Final commit: Total {documents_indexed} Airtable records processed"
|
||||
)
|
||||
await session.commit()
|
||||
logger.info(
|
||||
"Successfully committed all Airtable document changes to database"
|
||||
|
|
|
|||
|
|
@ -353,10 +353,12 @@ async def index_clickup_tasks(
|
|||
session.add(document)
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully indexed new task {task_name}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} ClickUp tasks processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} ClickUp tasks processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -367,10 +367,12 @@ async def index_confluence_pages(
|
|||
session.add(document)
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully indexed new page {page_title}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Confluence pages processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Confluence pages processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
@ -390,7 +392,9 @@ async def index_confluence_pages(
|
|||
await update_connector_last_indexed(session, connector, update_last_indexed)
|
||||
|
||||
# Final commit for any remaining documents not yet committed in batches
|
||||
logger.info(f"Final commit: Total {documents_indexed} Confluence pages processed")
|
||||
logger.info(
|
||||
f"Final commit: Total {documents_indexed} Confluence pages processed"
|
||||
)
|
||||
await session.commit()
|
||||
logger.info(
|
||||
"Successfully committed all Confluence document changes to database"
|
||||
|
|
|
|||
|
|
@ -461,10 +461,12 @@ async def index_discord_messages(
|
|||
logger.info(
|
||||
f"Successfully indexed new channel {guild_name}#{channel_name} with {len(formatted_messages)} messages"
|
||||
)
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Discord channels processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Discord channels processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
@ -482,7 +484,9 @@ async def index_discord_messages(
|
|||
await update_connector_last_indexed(session, connector, update_last_indexed)
|
||||
|
||||
# Final commit for any remaining documents not yet committed in batches
|
||||
logger.info(f"Final commit: Total {documents_indexed} Discord channels processed")
|
||||
logger.info(
|
||||
f"Final commit: Total {documents_indexed} Discord channels processed"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
# Prepare result message
|
||||
|
|
|
|||
|
|
@ -380,10 +380,12 @@ async def index_github_repos(
|
|||
)
|
||||
session.add(document)
|
||||
documents_processed += 1
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_processed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_processed} GitHub files processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_processed} GitHub files processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as repo_err:
|
||||
|
|
|
|||
|
|
@ -406,10 +406,12 @@ async def index_google_calendar_events(
|
|||
session.add(document)
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully indexed new event {event_summary}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Google Calendar events processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Google Calendar events processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
@ -428,7 +430,9 @@ async def index_google_calendar_events(
|
|||
await update_connector_last_indexed(session, connector, update_last_indexed)
|
||||
|
||||
# Final commit for any remaining documents not yet committed in batches
|
||||
logger.info(f"Final commit: Total {documents_indexed} Google Calendar events processed")
|
||||
logger.info(
|
||||
f"Final commit: Total {documents_indexed} Google Calendar events processed"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
await task_logger.log_task_success(
|
||||
|
|
|
|||
|
|
@ -323,10 +323,12 @@ async def index_google_gmail_messages(
|
|||
session.add(document)
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully indexed new email {summary_content}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Gmail messages processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Gmail messages processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -351,10 +351,12 @@ async def index_jira_issues(
|
|||
logger.info(
|
||||
f"Successfully indexed new issue {issue_identifier} - {issue_title}"
|
||||
)
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Jira issues processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Jira issues processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -370,10 +370,12 @@ async def index_linear_issues(
|
|||
logger.info(
|
||||
f"Successfully indexed new issue {issue_identifier} - {issue_title}"
|
||||
)
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Linear issues processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Linear issues processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -437,10 +437,12 @@ async def index_luma_events(
|
|||
session.add(document)
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully indexed new event {event_name}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Luma events processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Luma events processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -356,12 +356,14 @@ async def index_notion_pages(
|
|||
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully updated Notion page: {page_title}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} documents processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} documents processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
|
||||
continue
|
||||
|
||||
# Document doesn't exist - create new one
|
||||
|
|
@ -411,10 +413,12 @@ async def index_notion_pages(
|
|||
session.add(document)
|
||||
documents_indexed += 1
|
||||
logger.info(f"Successfully indexed new Notion page: {page_title}")
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} documents processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} documents processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -353,12 +353,14 @@ async def index_slack_messages(
|
|||
|
||||
session.add(document)
|
||||
documents_indexed += 1
|
||||
|
||||
|
||||
# Batch commit every 10 documents
|
||||
if documents_indexed % 10 == 0:
|
||||
logger.info(f"Committing batch: {documents_indexed} Slack channels processed so far")
|
||||
logger.info(
|
||||
f"Committing batch: {documents_indexed} Slack channels processed so far"
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
|
||||
logger.info(
|
||||
f"Successfully indexed new channel {channel_name} with {len(formatted_messages)} messages"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue