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

Kill JsonIO and fix JSON driver caching issues #2796

Merged
merged 6 commits into from
Jun 27, 2019

Conversation

Tobotimus
Copy link
Member

@Tobotimus Tobotimus commented Jun 24, 2019

I admit I got a bit carried away and killed my least favourite module in all of Red!

This PR fixes #2793 with the solution described in my comment on that issue.

The reasons for killing JsonIO were mainly:

  • The JSON driver should be managing its lock, rather than the a JsonIO class (this is really the one which defeats the purpose of JsonIO)
  • It's an unnecessary level of abstraction
  • All of the names of the _threadsafe methods were misleading

Other changes include:

  • Removing a deepcopy() on all of a cog's data every time a JSON is saved (oof)
  • Using pickle.loads(pickle.dumps()) over deepcopy() everywhere in Config and the JSON driver

@Tobotimus Tobotimus added QA: Needed Type: Removal This intends to remove some functionality. labels Jun 24, 2019
@Tobotimus Tobotimus requested a review from tekulvw as a code owner June 24, 2019 08:27
Signed-off-by: Toby Harradine <[email protected]>
Signed-off-by: Toby Harradine <[email protected]>
@Tobotimus
Copy link
Member Author

I've updated the header of this PR with more info 😃

@Tobotimus Tobotimus added this to the 3.1.3 milestone Jun 27, 2019
Copy link
Contributor

@mikeshardmind mikeshardmind left a comment

Choose a reason for hiding this comment

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

👍

@mikeshardmind mikeshardmind merged commit bff7e21 into Cog-Creators:V3/develop Jun 27, 2019
@Tobotimus Tobotimus deleted the V3/bugfix/2793 branch July 14, 2019 04:57
@Jackenmen Jackenmen added the Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. label Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. Type: Removal This intends to remove some functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Config] Cache is set to new object even if object isn't JSON serializable
4 participants