/** * @see ome.api.IRepositoryInfo#sanityCheckRepository() */ @RolesAllowed("user") public void sanityCheckRepository() throws InternalException { if (needsSanityCheck()) { synchronized (lastLock) { // Check the time again, in case another thread // updated the values. if (needsSanityCheck()) { try { lastUsage = getUsageFraction() * 100; } catch (Throwable t) { log.error( "Critical failure sanity checking repository.", t); throw new InternalException( "Error in sanityCheckRepository(): " + t.getMessage()); } lastCheck = System.currentTimeMillis(); } } } if (lastUsage > CRITICAL_USAGE) { throw new ResourceError(String.format( "Server repository disk space usage (%s%%) exceeds %s%%", lastUsage, CRITICAL_USAGE)); } }