minor clean-up

This commit is contained in:
alexlamsl 2018-01-16 15:40:25 +08:00
parent 42b3246eb8
commit d89a37de5e

View File

@ -1,5 +1,9 @@
"use strict"; "use strict";
var child_process = require("child_process");
var https = require("https");
var url = require("url");
var period = 45 * 60 * 1000; var period = 45 * 60 * 1000;
var wait = 2 * 60 * 1000; var wait = 2 * 60 * 1000;
var ping = 5 * 60 * 1000; var ping = 5 * 60 * 1000;
@ -10,16 +14,16 @@ if (process.argv[2] == "run") {
var branch = process.argv[3] || "v" + require("../package.json").version; var branch = process.argv[3] || "v" + require("../package.json").version;
var repository = encodeURIComponent(process.argv[4] || "mishoo/UglifyJS2"); var repository = encodeURIComponent(process.argv[4] || "mishoo/UglifyJS2");
var concurrency = process.argv[5] || 1; var concurrency = process.argv[5] || 1;
(function init() { (function request() {
setTimeout(init, (period + wait) / concurrency); setTimeout(request, (period + wait) / concurrency);
var options = require("url").parse("https://api.travis-ci.org/repo/" + repository + "/requests"); var options = url.parse("https://api.travis-ci.org/repo/" + repository + "/requests");
options.method = "POST"; options.method = "POST";
options.headers = { options.headers = {
"Content-Type": "application/json", "Content-Type": "application/json",
"Travis-API-Version": 3, "Travis-API-Version": 3,
"Authorization": "token " + token "Authorization": "token " + token
}; };
require("https").request(options, function(res) { https.request(options, function(res) {
console.log("HTTP", res.statusCode); console.log("HTTP", res.statusCode);
console.log(JSON.stringify(res.headers, null, 2)); console.log(JSON.stringify(res.headers, null, 2));
console.log(); console.log();
@ -44,7 +48,7 @@ if (process.argv[2] == "run") {
} }
function spawn() { function spawn() {
var child = require("child_process").spawn("node", [ var child = child_process.spawn("node", [
"--max-old-space-size=2048", "--max-old-space-size=2048",
"test/ufuzz" "test/ufuzz"
], { ], {