| | |
| | | } |
| | | |
| | | /** |
| | | * Reset all caches for this repository. |
| | | * |
| | | * @param repositoryName |
| | | * @since 1.5.1 |
| | | */ |
| | | @Override |
| | | public void resetRepositoryCache(String repositoryName) { |
| | | removeFromCachedRepositoryList(repositoryName); |
| | | clearRepositoryMetadataCache(repositoryName); |
| | | // force a reload of the repository data (ticket-82, issue-433) |
| | | getRepositoryModel(repositoryName); |
| | | } |
| | | |
| | | /** |
| | | * Resets the repository list cache. |
| | | * |
| | | */ |
| | |
| | | // http://stackoverflow.com/questions/17183110 |
| | | repositoryName = repositoryName.replace("%7E", "~").replace("%7e", "~"); |
| | | |
| | | if (!repositoryListCache.containsKey(repositoryName)) { |
| | | String repositoryKey = repositoryName.toLowerCase(); |
| | | if (!repositoryListCache.containsKey(repositoryKey)) { |
| | | RepositoryModel model = loadRepositoryModel(repositoryName); |
| | | if (model == null) { |
| | | return null; |
| | |
| | | } |
| | | |
| | | // cached model |
| | | RepositoryModel model = repositoryListCache.get(repositoryName.toLowerCase()); |
| | | RepositoryModel model = repositoryListCache.get(repositoryKey); |
| | | |
| | | if (gcExecutor.isCollectingGarbage(model.name)) { |
| | | // Gitblit is busy collecting garbage, use our cached model |