Skip to content

Commit

Permalink
Create a job schedule which re-initializes the conversation buffer ro…
Browse files Browse the repository at this point in the history
…ughly every 24 hrs
  • Loading branch information
sabaimran committed Aug 30, 2023
1 parent 2eba43f commit 114d8bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/flint/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,13 @@ def upload_telemetry():
logger.error(f"📡 Error uploading telemetry: {e}", exc_info=True)
finally:
telemetry.clear()


@schedule.repeat(schedule.every(1439).minutes)
def clear_conversations():
from flint import state

start_time = datetime.now()
logger.info("Re-initializing conversation sessions")
state.conversation_sessions = initialize_conversation_sessions()
logger.info(f"Re-initializing conversation sessions took {datetime.now() - start_time}")

0 comments on commit 114d8bd

Please sign in to comment.