Browse Source

Extend cache times for bad sources

David Cramer 10 years ago
parent
commit
99a3163fef
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/sentry/tasks/fetch_source.py

+ 5 - 2
src/sentry/tasks/fetch_source.py

@@ -167,8 +167,11 @@ def fetch_url(url):
     result = cache.get(cache_key)
     if result is None:
         result = fetch_url_content(url)
-
-        cache.set(cache_key, result, 60)
+        if result == BAD_SOURCE:
+            timeout = 300
+        else:
+            timeout = 60
+        cache.set(cache_key, result, timeout)
 
     if result == BAD_SOURCE:
         return result