DeleteWatchedProjects: Don't evict account cache when nothing was deleted

Change-Id: I41c0c10af7a1326208ff55dedcec580faf83c55f
This commit is contained in:
David Pursehouse
2016-07-08 21:44:51 +09:00
parent 7afaf6f8f8
commit d86fc5634c

View File

@@ -79,8 +79,10 @@ public class DeleteWatchedProjects
watchesToDelete.add(watchedProjectsMap.get(key));
}
}
dbProvider.get().accountProjectWatches().delete(watchesToDelete);
accountCache.evict(accountId);
if (!watchesToDelete.isEmpty()) {
dbProvider.get().accountProjectWatches().delete(watchesToDelete);
accountCache.evict(accountId);
}
}
return Response.none();
}