Skip to content

Commit

Permalink
Handles disappearing availability bug with group transaction. (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
meagancheese authored Aug 7, 2020
1 parent c88e742 commit fb42253
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,15 @@ public void deleteInRangeForUser(String userId, Instant minTime, Instant maxTime
keyList.add(entity.getKey());
}
// This iterative deletion avoids XG transactions, which max out at 25 root entities.
// We include the individual deletion transactions within a larger group transaction
// to avoid replacing Availabilities before they are deleted.
Transaction groupTxn = datastore.beginTransaction();
for (Key key : keyList) {
Transaction txn = datastore.beginTransaction();
datastore.delete(txn, key);
txn.commit();
}
groupTxn.commit();
}

// Returns a sorted (by ascending start times) list of all Availabilities ranging from
Expand Down

0 comments on commit fb42253

Please sign in to comment.