Skip to content

Commit

Permalink
Fixed cache invalidation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jul 9, 2014
1 parent af95032 commit f7428a1
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,21 @@ public class HooksIntegrationService
public Response githubUpdateRepository(String payload) throws Exception
{
String repo = null;
String gitRepo = null;
if (payload != null)
{
Gson gson = new Gson();
Map<?, ?> json = gson.fromJson(payload, Map.class);
Map<?, ?> repository = (Map<?, ?>) json.get("repository");
repo = (String) repository.get("url");
if (repo.startsWith("http") && !repo.endsWith(".git"))
repo = repo + ".git";
{
gitRepo = repo + ".git";
}
else
{
gitRepo = repo;
}
}

if (repo == null || repo.isEmpty())
Expand All @@ -56,7 +63,7 @@ public Response githubUpdateRepository(String payload) throws Exception
{
try
{
invalidateRedoculous(repo);
invalidateRedoculous(gitRepo);
}
finally
{
Expand Down

0 comments on commit f7428a1

Please sign in to comment.