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

Improve GetRemoteStatus and db.GetStatus() logic #174

Conversation

NyaaaWhatsUpDoc
Copy link
Member

  • removes chance of db.GetStatus() recursion
  • improves GetRemoteStatus() to require specifying if parent / children are required in status
  • fix StatusCache to return object copies, and only store information about status itself (not related attachments)
  • set cache=shared by default on SQLite instances to ensure thread-safety between operations (this was the source of the nested transaction related errors we were seeing). why this was not set as a default in a Go library where you have to go out of your way to run single-threaded?! who knows

@NyaaaWhatsUpDoc
Copy link
Member Author

Snuck in another bugfix with a panic caused by EnrichRemoteAccount :)

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc force-pushed the bugfix/improve-getstatus-logic branch from ab1f141 to 64d422f Compare August 30, 2021 20:40
Signed-off-by: kim (grufwub) <[email protected]>
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc force-pushed the bugfix/improve-getstatus-logic branch from 64d422f to e56d819 Compare August 30, 2021 20:47
Copy link
Contributor

@tsmethurst tsmethurst left a comment

Choose a reason for hiding this comment

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

Just the testing stuff needs to change, the rest looks great 👍

internal/cache/account_test.go Outdated Show resolved Hide resolved
internal/db/bundb/account.go Show resolved Hide resolved
internal/db/bundb/bundb.go Show resolved Hide resolved
internal/db/bundb/conn.go Show resolved Hide resolved
internal/db/bundb/relationship.go Show resolved Hide resolved
internal/db/bundb/status.go Show resolved Hide resolved
@tsmethurst tsmethurst linked an issue Aug 31, 2021 that may be closed by this pull request
@tsmethurst tsmethurst merged commit 7d193de into superseriousbusiness:main Sep 1, 2021
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc deleted the bugfix/improve-getstatus-logic branch September 10, 2021 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recursion performance issues
2 participants