guibacellar / TEx

Telegram Monitor
Apache License 2.0
316 stars 43 forks source link

Quality of Life - Automatic Database Maintenance #43

Open guibacellar opened 10 months ago

guibacellar commented 10 months ago

Today, Database Maintenance are only possible through cmd command, but, that require to stop all Telegram Explorer processes and can take a long time for hundred groups.

Create a new option to enable a automatic maintenance while run the "listen" command to keep DB health and smallest as possible.

Allow do specify the cycle time (hourly, every 2 hours, etc), retention period (ex: keep only 7 days, keep the last 60 days) and downloaded files retention separately by mime-type (like media final control). Note: Individual Media Retention Period CANNOT be greater the Messages Retention Period.

Example Config:

[DB.AutoMaintenance] enabled=true messages_retention_period_days=60 default_media_retention_period_days=7

[DB.AutoMaintenance.Media.image/gif] retention_period_days=30

[DB.AutoMaintenance.Media.application/rar] retention_period_days=30