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

feat(leaser): migrate leases in batches #99

Merged
merged 6 commits into from
May 19, 2023
Merged

feat(leaser): migrate leases in batches #99

merged 6 commits into from
May 19, 2023

Conversation

gmanev7
Copy link
Member

@gmanev7 gmanev7 commented May 18, 2023

No description provided.

Copy link
Contributor

@KirilMihaylov KirilMihaylov left a comment

Choose a reason for hiding this comment

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

May the 4th was not with us today. 😞

contracts/leaser/src/migrate.rs Outdated Show resolved Hide resolved
contracts/leaser/src/msg.rs Outdated Show resolved Hide resolved
contracts/leaser/src/migrate.rs Outdated Show resolved Hide resolved
contracts/leaser/src/migrate.rs Outdated Show resolved Hide resolved
contracts/leaser/src/migrate.rs Outdated Show resolved Hide resolved
contracts/leaser/src/migrate.rs Show resolved Hide resolved
contracts/leaser/src/migrate.rs Show resolved Hide resolved
contracts/leaser/src/migrate.rs Show resolved Hide resolved
contracts/leaser/src/migrate.rs Show resolved Hide resolved
contracts/leaser/src/msg.rs Outdated Show resolved Hide resolved
contracts/leaser/src/migrate.rs Outdated Show resolved Hide resolved
Comment on lines 85 to 86
if leases_nb <= self.leases_left {
self.leases_left -= leases_nb;
Copy link
Contributor

Choose a reason for hiding this comment

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

My point was that because of how we compile it, it will check again for underflow.
My general idea was to use if let Some(result) = self.leases_left.checked_sub(leases_nb) { ... } else { Some(Ok(customer.customer)) }. Just to simplify the binary that will be generated.

@gmanev7 gmanev7 merged commit f5a4f15 into main May 19, 2023
@gmanev7 gmanev7 deleted the migrate_in_batches branch May 19, 2023 10: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