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

Atomic insertion of presignatures and triples #68

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

volovyks
Copy link
Contributor

Insert and take operations must be atomic. Lua may seem an overhead when we have 2 simple operations, but I want to have a unified approach for storage and flexibility. Already planning to extend those scripts with additional checks.
Also, scripts can be preloaded to Redis, so there is no need to transfer and build them on each call. We may add that optimization when required.

@volovyks
Copy link
Contributor Author

@ChaoticTempest I've fixed the tests

.key(self.triple_key())
.arg(triple.id)
.arg(triple)
.arg(mine.to_string())
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we just send it as a bool instead of a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default, it is serialized as o or 1, so our script will look like if mine == "1". True/false is more readable both in code and when debugging redis storage directly.

@volovyks volovyks merged commit 68071b6 into develop Dec 17, 2024
2 of 3 checks passed
@volovyks volovyks deleted the serhii/atomic-storage-operations branch December 17, 2024 16:36
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.

2 participants