mirror of
https://github.com/google/nomulus
synced 2026-02-12 15:51:34 +00:00
Replace many Work and VoidWork usages with lambdas
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=176153460
This commit is contained in:
@@ -20,7 +20,6 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import com.google.appengine.tools.mapreduce.Reducer;
|
||||
import com.google.appengine.tools.mapreduce.ReducerInput;
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.VoidWork;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,11 +36,7 @@ public class KillAllEntitiesReducer extends Reducer<Key<?>, Key<?>, Void> {
|
||||
while (batches.hasNext()) {
|
||||
final List<Key<?>> batch = batches.next();
|
||||
// Use a transaction to get retrying for free.
|
||||
ofy().transact(new VoidWork() {
|
||||
@Override
|
||||
public void vrun() {
|
||||
ofy().deleteWithoutBackup().keys(batch);
|
||||
}});
|
||||
ofy().transact(() -> ofy().deleteWithoutBackup().keys(batch));
|
||||
getContext().incrementCounter("entities deleted", batch.size());
|
||||
for (Key<?> key : batch) {
|
||||
getContext().incrementCounter(String.format("%s deleted", key.getKind()));
|
||||
|
||||
Reference in New Issue
Block a user