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

Seperate the load and save data sources #7100

Merged
merged 2 commits into from
Dec 26, 2023
Merged

Conversation

Warriorrrr
Copy link
Member

Description:

Fixes a minor memory/connection leak when using mysql, the load datasource is now properly shut down when it's no longer needed and re-used if possible. By re-using it we also avoid doing some double work, such as all the tables being checked & altered, which saves a bit of time.


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

@Warriorrrr Warriorrrr added this to the 0.100.1.0 milestone Nov 22, 2023
Comment on lines +123 to +127
synchronized(queryQueue) {
while (!this.queryQueue.isEmpty()) {
Runnable operation = this.queryQueue.poll();
operation.run();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this synchronized, is this how we get around the issue that required the SQL source to use the isPolling variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the idea yes

@LlmDl LlmDl merged commit b439148 into master Dec 26, 2023
4 checks passed
@LlmDl LlmDl deleted the feat/data-source-seperation branch December 26, 2023 17:25
LlmDl added a commit that referenced this pull request Dec 26, 2023
  - Update Towny/Sponsor plugins list.
  - Correct townblock reporting in debug messages no one sees.
  - Make the TownyUniverse code a bit more readable.
  - Seperate the load and save data sources, courtesy of Warrior with
PR #7100.
    - Fixes a minor memory/connection leak when using mysql, the load
datasource is now properly shut down when it's no longer needed and
re-used if possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants