Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ module.exports = {
{
"files": ["*.js"],
"rules": {
"guard-for-in": "warn", // TODO(bkendall): remove, allow to error.
"no-extra-boolean-cast": "warn", // TODO(bkendall): remove, allow to error.
"no-invalid-this": "warn", // TODO(bkendall): remove, allow to error.
"no-redeclare": "warn", // TODO(bkendall): remove, allow to error.
"no-undef": "warn", // TODO(bkendall): remove, allow to error.
"no-var": "warn", // TODO(bkendall): remove, allow to error.
"one-var": "warn", // TODO(bkendall): remove, allow to error.
"prefer-rest-params": "warn", // TODO(bkendall): remove, allow to error.
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/deploy/functions/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ module.exports = function(context, options, payload) {
});
var uploadedNames = _.map(functionsInfo, "name");
var functionFilterGroups = helper.getFilterGroups(options);
var deleteReleaseNames, existingScheduledFunctions;
var deleteReleaseNames;
var existingScheduledFunctions;

delete payload.functions;
return gcp.cloudfunctions
Expand Down
6 changes: 3 additions & 3 deletions src/deploy/hosting/hashcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function cachePath(cwd, name) {
exports.load = function(cwd, name) {
try {
const out = {};
lines = fs.readFileSync(cachePath(cwd, name), {
const lines = fs.readFileSync(cachePath(cwd, name), {
encoding: "utf8",
});
lines.split("\n").forEach(function(line) {
Expand All @@ -32,9 +32,9 @@ exports.load = function(cwd, name) {
exports.dump = function(cwd, name, data) {
let st = "";
let count = 0;
for (let path in data) {
for (const [path, d] of data) {
count++;
st += path + "," + data[path].mtime + "," + data[path].hash + "\n";
st += path + "," + d.mtime + "," + d.hash + "\n";
}
try {
fs.outputFileSync(cachePath(cwd, name), st, { encoding: "utf8" });
Expand Down
6 changes: 3 additions & 3 deletions src/deploy/hosting/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Uploader {
this.fileCount = this.files.length;

this.cache = hashcache.load(this.projectRoot, this.hashcacheName());
this.cacheNew = {};
this.cacheNew = new Map();

this.sizeMap = {};
this.hashMap = {};
Expand Down Expand Up @@ -141,7 +141,7 @@ class Uploader {
this.sizeMap[filePath] = stats.size;
const cached = this.cache[filePath];
if (cached && cached.mtime === mtime) {
this.cacheNew[filePath] = cached;
this.cacheNew.set(filePath, cached);
this.addHash(filePath, cached.hash);
return Promise.resolve();
}
Expand All @@ -155,7 +155,7 @@ class Uploader {
return new Promise(function(resolve, reject) {
fstream.on("end", function() {
const hashVal = hash.read().toString("hex");
self.cacheNew[filePath] = { mtime: mtime, hash: hashVal };
self.cacheNew.set(filePath, { mtime: mtime, hash: hashVal });
self.addHash(filePath, hashVal);
resolve();
});
Expand Down
10 changes: 6 additions & 4 deletions src/functionsDelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ var clc = require("cli-color");

var cloudfunctions = require("./gcp/cloudfunctions");
var cloudscheduler = require("./gcp/cloudscheduler");
var pubsub = require("./gcp/pubsub");
var FirebaseError = require("./error");
var helper = require("./functionsDeployHelper");
var logger = require("./logger");
var pubsub = require("./gcp/pubsub");
var track = require("./track");
var utils = require("./utils");

Expand Down Expand Up @@ -50,8 +51,9 @@ var printTooManyOps = function(projectId) {

module.exports = function(functionsToDelete, projectId, appEngineLocation) {
deletes = _.map(functionsToDelete, function(name) {
var scheduleName = helper.getScheduleName(name, appEngineLocation);
var topicName = helper.getTopicName(name);
const scheduleName = helper.getScheduleName(name, appEngineLocation);
const topicName = helper.getTopicName(name);
const functionName = helper.getFunctionName(name);
return {
name: name,
retryFunction: function() {
Expand Down Expand Up @@ -84,7 +86,7 @@ module.exports = function(functionsToDelete, projectId, appEngineLocation) {
return cloudfunctions.delete({
projectId: projectId,
region: helper.getRegion(name),
functionName: helper.getFunctionName(name),
functionName,
});
});
},
Expand Down