Clear report cache when report is closed

This commit is contained in:
Keir Nellyer 2016-06-10 12:41:02 +01:00
parent 09009c352b
commit 36f47b7067
2 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,7 @@ public class ReportManager
report.setHandlerId(closerId);
report.setReportResult(reportResult);
_reportRepository.updateReport(report);
_reportRepository.updateReport(report).thenAccept(voiD -> _reportRepository.clearCache(reportId));
if (reportCloser != null)
{

View File

@ -438,6 +438,11 @@ public class ReportRepository extends MinecraftRepository
}
}
protected void clearCache(int reportId)
{
_cachedReports.invalidate(reportId);
}
/**
* Checks if either the suspect or handler (if any) are online.
* If either are online then this will return true, otherwise false.