Skip to content

Commit

Permalink
reverts without getting a db lock in case the data already exists to …
Browse files Browse the repository at this point in the history
…improve performance
  • Loading branch information
shubham1g5 committed Jan 3, 2025
1 parent 25a9317 commit ea93ab7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/commcare/cases/entity/AsyncEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ public String getNormalizedField(int i) {

@Override
public String getSortField(int i) {
synchronized (mAsyncLock) {
if (sortData[i] != null) {
return sortData[i];
}
}
try (Closeable ignored = mEntityStorageCache != null ? mEntityStorageCache.lockCache() : null) {
//get our second lock.
synchronized (mAsyncLock) {
Expand Down

0 comments on commit ea93ab7

Please sign in to comment.