Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to Disable Automatic Database Logging of Updates #1484

Open
cyrus-fa opened this issue Jan 9, 2025 · 3 comments
Open

Option to Disable Automatic Database Logging of Updates #1484

cyrus-fa opened this issue Jan 9, 2025 · 3 comments

Comments

@cyrus-fa
Copy link

cyrus-fa commented Jan 9, 2025

🎉 Feature Request

Summary

I noticed that the library automatically inserts all updates into the database, which is handled in the DB.php file.

However, in my case, this behavior leads to unnecessary data accumulation in my database, as I don’t need to log all updates. Is there a way to disable or customize this behavior without modifying the core library files?

@jacklul
Copy link
Collaborator

jacklul commented Jan 10, 2025

While not ideal you might simply add a trigger or schedule in the database to clean the table periodically

@Koorosh14
Copy link

You can extend a new class from Telegram.php and another one from DB.php, change them however you like, and then use those classes in your codes instead of the main ones.
I've done something similar here:
https://github.com/FourteenDev/telegram-bot-wordpress-plugin-boilerplate/tree/main/src/Telegram/ExtendedClasses

@cyrus-fa
Copy link
Author

@jacklul @Koorosh14, Thank you both for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants