Commits

Anonymous committed 54b7fda

clearcache uses commit_on_success() to make sure database caches are actually cleared

  • Participants
  • Parent commits a915c1a

Comments (0)

Files changed (1)

 
 # Clear the cache via the Django cache API
 function clearcache() {
-    python -c "from django.core.cache import cache; cache.clear()"
+    python << EOF
+from django.core.cache import cache
+from django.db.transaction import commit_on_success
+
+commit_on_success(cache.clear)()
+EOF
 }
 
 # Gracefully restart Apache if configuration test is succesful