Purge git serving URLs as well, not just the gitweb view
authorMagnus Hagander <magnus@hagander.net>
Sat, 13 Apr 2013 13:56:16 +0000 (15:56 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sat, 13 Apr 2013 13:56:16 +0000 (15:56 +0200)
Without this, a "git fetch" could become very delayed when accessing
the repositories, since the contents might be cached.

triggers.py

index b7eebfdfd26c9ba22d05aee0e97e643e24541a8b..78bd2d29c23a1f4deeda1eff0913050c31c3600a 100644 (file)
@@ -26,7 +26,10 @@ class varnishpurger(object):
        def pushtrigger(self, reponame, username):
                # Make a callback to a local varnish server to purge a repository
                # from it. Assumes gitweb style URLs.
-               for u in ['^/gitweb/?$', '^/gitweb/\?p=%s.git' % reponame]:
+               # Also, purge the actual http serving git repo itself.
+               for u in ['^/gitweb/?$',
+                                 '^/gitweb/\?p=%s.git' % reponame,
+                                 '^/git/%s' % reponame]:
                        if not self._internal_purge(u):
                                print "Varnish purge failed, website may become slightly out of date"
                                return