Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void close() {
@Override
public boolean delete(String lock) {
return this.defaultTransactionTemplate.execute(
transactionStatus -> this.template.update(this.deleteQuery, this.region, lock, this.id)) > 0;
transactionStatus -> this.template.update(this.deleteQuery, this.region, lock, this.id)) == 1;
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure what difference with existing style.
How whatever you have done here helps with readability?

Copy link
Contributor Author

@EddieChoCho EddieChoCho Oct 30, 2024

Choose a reason for hiding this comment

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

I think readers can easily understand that only one lock ownership is expected to be deleted.

Copy link
Member

Choose a reason for hiding this comment

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

That's debatable. Because you see: for me this does nothing.
However to save both our time discussing this I'll go ahead and merge.

}

@Override
Expand Down Expand Up @@ -436,7 +436,7 @@ public void deleteExpired() {
public boolean renew(String lock) {
final Boolean result = this.defaultTransactionTemplate.execute(
transactionStatus ->
this.template.update(this.renewQuery, epochMillis(), this.region, lock, this.id) > 0);
this.template.update(this.renewQuery, epochMillis(), this.region, lock, this.id) == 1);
return Boolean.TRUE.equals(result);
}

Expand Down