Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1099)

Unified Diff: Tools/GardeningServer/scripts/rollbot.js

Issue 173133003: Convert garden-o-matic guts over to promises where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update to ToT Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/GardeningServer/scripts/rollbot.js
diff --git a/Tools/GardeningServer/scripts/rollbot.js b/Tools/GardeningServer/scripts/rollbot.js
index 3a42e100c913065af7dd6ca449a6782a5251e061..bbf9e9272ba7e864ca895949a7b5d014e6fc8e83 100644
--- a/Tools/GardeningServer/scripts/rollbot.js
+++ b/Tools/GardeningServer/scripts/rollbot.js
@@ -53,23 +53,21 @@ function isRollbotStopped(issue) {
return issue.messages.slice(1).some(function(message) { return message.text.match(/STOP/); });
}
-rollbot.fetchCurrentRoll = function(callback) {
- net.json(issueSearchURL).then(function(searchJSON) {
+rollbot.fetchCurrentRoll = function() {
+ return net.json(issueSearchURL).then(function(searchJSON) {
var issue = findRollIssue(searchJSON);
- if (!issue) {
- callback(null);
- return;
- }
+ if (!issue)
+ return null;
var issueNumber = issue['issue'];
var subjectMatch = issue['subject'].match(rollSubjectRegexp);
- callback({
+ return {
'issue': issueNumber,
'url': config.kRietveldURL + "/" + issueNumber,
'isStopped': isRollbotStopped(issue),
'fromRevision': subjectMatch[1],
'toRevision': subjectMatch[2],
- });
+ };
});
};
« no previous file with comments | « Tools/GardeningServer/scripts/results_unittests.js ('k') | Tools/GardeningServer/scripts/rollbot_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698