Perf dashboard always fetches charts JSON twice
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Nov 2015 20:35:18 +0000 (20:35 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Nov 2015 20:35:18 +0000 (20:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151483

Reviewed by Andreas Kling.

Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
obsolete (shouldRefetch is set true) or corrupt (the second closure).

* public/v2/app.js:
(App.Pane._fetch):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v2/app.js

index e99f67d..9b5d461 100644 (file)
@@ -1,3 +1,16 @@
+2015-11-19  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Perf dashboard always fetches charts JSON twice
+        https://bugs.webkit.org/show_bug.cgi?id=151483
+
+        Reviewed by Andreas Kling.
+
+        Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
+        obsolete (shouldRefetch is set true) or corrupt (the second closure).
+
+        * public/v2/app.js:
+        (App.Pane._fetch):
+
 2015-11-18  Ryosuke Niwa  <rniwa@webkit.org>
 
         Internal perf dashboard takes forever to load
 2015-11-18  Ryosuke Niwa  <rniwa@webkit.org>
 
         Internal perf dashboard takes forever to load
index 60b620d..0217ba0 100644 (file)
@@ -355,11 +355,13 @@ App.Pane = Ember.Object.extend({
             var useCache = true;
             App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId, null, useCache)
                 .then(function (result) {
             var useCache = true;
             App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId, null, useCache)
                 .then(function (result) {
-                    if (result || result.shouldRefetch)
+                    if (!result || !result.data || result.shouldRefetch)
                         self.refetchRuns(platformId, metricId);
                         self.refetchRuns(platformId, metricId);
-                    if (result)
+                    else
                         self._didFetchRuns(result);
                         self._didFetchRuns(result);
-                }, this._handleFetchErrors.bind(this, platformId, metricId));
+                }, function () {
+                    self.refetchRuns(platformId, metricId);
+                });
             if (!this.get('inDashboard'))
                 this.fetchAnalyticRanges();
         }
             if (!this.get('inDashboard'))
                 this.fetchAnalyticRanges();
         }