Skip to content

Add APScheduler for verse cleanup and implement expiration logic#860

Merged
tenkus47 merged 3 commits into
developfrom
scheduler
Jul 17, 2026
Merged

Add APScheduler for verse cleanup and implement expiration logic#860
tenkus47 merged 3 commits into
developfrom
scheduler

Conversation

@tenkus47

Copy link
Copy Markdown
Member
  • Integrated APScheduler to manage daily cleanup of expired verses of the day.
  • Added configuration for verse retention period in config.py.
  • Implemented cleanup_expired_verses_of_day function to delete verses older than the specified expiry days.
  • Updated database interaction to support deletion of expired verses.
  • Created tests to validate the cleanup functionality and ensure correct behavior.
  • should fix : issue auto delete the verse of the day other than last 1 week detail #855

tenkus47 and others added 2 commits July 16, 2026 14:44
- Integrated APScheduler to manage daily cleanup of expired verses of the day.
- Added configuration for verse retention period in `config.py`.
- Implemented `cleanup_expired_verses_of_day` function to delete verses older than the specified expiry days.
- Updated database interaction to support deletion of expired verses.
- Created tests to validate the cleanup functionality and ensure correct behavior.
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

This looks safe to merge.

  • Non-positive retention values are rejected before deletion.
  • Mongo and scheduler cleanup now run from the lifespan cleanup path.
  • No remaining blocking issue met the follow-up review scope.

Reviews (2): Last reviewed commit: "Enhance error handling for scheduler and..." | Re-trigger Greptile

Comment thread pecha_api/scheduler.py
Comment thread pecha_api/db/mongo_database.py Outdated
@tenkus47

Copy link
Copy Markdown
Member Author

it looks like sonarqube server is down for some reason. lets check later on

@tenkus47
tenkus47 requested a review from Tech-lo July 17, 2026 04:56
- Added validation to ensure `VERSE_OF_DAY_EXPIRY_DAYS` and `expiry_days` are positive integers, raising `ValueError` for invalid inputs.
- Updated the `lifespan` function to ensure proper cleanup of resources during initialization failures.
- Added tests to verify the new validation logic for both the scheduler setup and the cleanup function.
@sonarqubecloud

Copy link
Copy Markdown

@tenkus47
tenkus47 merged commit f49061d into develop Jul 17, 2026
8 checks passed
@tenkus47
tenkus47 deleted the scheduler branch July 17, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants