Closed Trip-kun closed 10 months ago
[!WARNING]
Rate Limit Exceeded
@Trip-kun has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 0 minutes and 42 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per repository. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between 0c2b85a14fc6f73490d044b9c03fc6710b574dcb and 255f1e64c941dded7c83e3236d8dc0e8d2813f5a.
The changes in the oatmeal
project involve a significant refactoring of the reminder system. The system has been migrated from using JSON-based storage to a MariaDB-based storage. This migration required the removal of the DataMode
and related JSON storage classes. Instead, new MariaDB entities and methods have been introduced to handle reminder data. The reminder functionality has been updated across various classes to accommodate these changes. Overall, these changes improve the efficiency and scalability of the reminder system in the project.
File(s) | Summary |
---|---|
src/main/java/wtf/triplapeeck/oatmeal/Config.java |
Removed DataMode import and variable. dataMode field is no longer used. |
src/main/java/wtf/triplapeeck/oatmeal/Main.java |
Removed DataMode and JSONStorableFactory imports. Always initializes dataManager as MariaManager . |
src/main/java/wtf/triplapeeck/oatmeal/commands/CommandHandler.java |
Removed GenericData and GenericJSONStorable imports and usage. |
src/main/java/wtf/triplapeeck/oatmeal/commands/miscellaneous/Remind.java |
Added ReminderData and Main imports. Updated saving of reminder data and message sent in the channel. |
src/main/java/wtf/triplapeeck/oatmeal/entities/ReminderData.java |
Introduced new abstract class for reminder data. |
src/main/java/wtf/triplapeeck/oatmeal/entities/UserData.java |
Removed getReminders() and setReminders() methods. |
src/main/java/wtf/triplapeeck/oatmeal/entities/mariadb/MariaReminder.java |
Introduced new class for MariaDB-based reminder entity. |
src/main/java/wtf/triplapeeck/oatmeal/entities/mariadb/MariaUser.java |
Removed reminder functionality from MariaUser class. |
src/main/java/wtf/triplapeeck/oatmeal/managers/DataManager.java |
Removed genericCache . Added new methods for reminder management. |
src/main/java/wtf/triplapeeck/oatmeal/managers/MariaManager.java |
Added ReminderData import. Updated methods for reminder management. |
src/main/java/wtf/triplapeeck/oatmeal/runnable/Heartbeat.java |
Removed GenericData , UserData , and GenericJSONStorable imports. Updated reminder handling logic. |
src/main/java/wtf/triplapeeck/oatmeal/runnable/NewTable.java |
Removed ChannelJSONStorable import and related variable. |
src/main/java/wtf/triplapeeck/oatmeal/runnable/TableUpdate.java |
Updated imports and removed ClosedStorableError exception handling. |
src/main/java/wtf/triplapeeck/oatmeal/util/ConfigParser.java |
Removed DataMode import and related method. |
src/main/java/wtf/triplapeeck/oatmeal/util/DatabaseUtil.java |
Added List import and introduced new methods for reminder entity management. |
🍂 As autumn leaves fall, so does old code retire, 🍁
Replaced by new lines, that the project does require. 📝
From JSON to MariaDB, reminders now flow, 🔄
Like rivers of data, in the moon's gentle glow. 🌙
Celebrate the changes, for they bring us delight, 🎉
As we code through the day, and debug through the night. 💻
So here's to the coders, in every nation, 🌍
Making the world better, through their dedication. 🙌
We don't need to keep "Maria" entities separate/named differently because ORMLite supports a wide range of JDBC based databases, automatically filling in the cracks for any Entity annotated correctly.
However, more importantly, the responsibility of ensuring Entities are processed correctly for the database type falls on the database implementation and provider, not the entity.
As this commit is just about removing the JSON system, it is not an issue as of now, but something to consider in the future.
Reminders moved to their own table; Better, less expensive iteration used.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores