This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch.js
53 lines (43 loc) · 1.55 KB
/
fetch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Background page stuff
*/
var buildStatus = {};
var refreshing = false;
var current_refresh = null;
function refresh() {
// we should never have more than one refresh going at any given time
if (refreshing)
// current_refresh should never be null
return current_refresh;
var review_nick = localStorage.getItem("review-nick");
console.log("Updating build status to ", new Date());
buildStatus.last_refresh = new Date();
console.log("kicking off refresh...");
buildStatus.versions = requestBlinkVersion()
.then(function(versions) {
if (chrome.browserAction) {
chrome.browserAction.setBadgeText({text: versions.blink_version});
chrome.browserAction.setTitle({title: "Blink revision: " + versions.blink_version});
}
return versions;
});
buildStatus.blink_feed = requestBlinkCommits();
buildStatus.chromium_feed = requestChromiumCommits();
buildStatus.chromium_queue = requestAllChromiumQueues(review_nick);
buildStatus.chromium_lkgr = requestChromiumLKGR();
buildStatus.blink_gardeners = requestBlinkGardeners();
refreshing = true;
current_refresh = Q.allSettled([
buildStatus.versions,
buildStatus.blink_feed,
buildStatus.chromium_feed,
buildStatus.chromium_queue,
buildStatus.chromium_lkgr,
buildStatus.blink_gardeners])
.then(function(result) {
refreshing = false;
return result;
});
return current_refresh;
};
refresh();