in src/main/java/com/googlesource/gerrit/plugins/deleteproject/database/DatabaseDeleteHandler.java [97:120]
public void atomicDelete(Project project, List<Change.Id> changeIds) {
deleteChanges(changeIds);
for (AccountState a : accountQueryProvider.get().byWatchedProject(project.getNameKey())) {
Account.Id accountId = a.account().id();
for (ProjectWatchKey watchKey : a.projectWatches().keySet()) {
if (project.getNameKey().equals(watchKey.project())) {
try {
accountsUpdateProvider
.get()
.update(
"Delete Project Watches via API",
accountId,
u -> u.deleteProjectWatches(singleton(watchKey)));
} catch (IOException | ConfigInvalidException e) {
log.atSevere().withCause(e).log(
"Removing watch entry for user %s in project %s failed.",
a.userName().orElse("[unknown]"), project.getName());
}
}
}
}
}