firebase-functions
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -1,2 +0,1 @@ | ||
changed - Removes temporary “shim” for analytics event timestamps. | ||
fixed - Fixes return type for DeltaSnapshot#getPriority() for database functions | ||
fixed - Fixes bug where database connections were being closed more frequently than necessary causing DNS quota issues. |
@@ -78,16 +78,7 @@ // The MIT License (MIT) | ||
}; | ||
Apps.prototype._waitToDestroyApp = function (appName) { | ||
var _this = this; | ||
Apps.prototype._destroyApp = function (appName) { | ||
if (!this._appAlive(appName)) { | ||
return Promise.resolve(); | ||
return; | ||
} | ||
return delay(120000).then(function () { | ||
if (!_this._appAlive(appName)) { | ||
return; | ||
} | ||
if (_.get(_this._refCounter, appName) === 0) { | ||
delete _this._refCounter[appName]; | ||
return firebase.app(appName).delete().catch(_.noop); | ||
} | ||
}); | ||
firebase.app(appName).delete().catch(_.noop); | ||
}; | ||
@@ -101,3 +92,3 @@ Apps.prototype.retain = function (payload) { | ||
_.update(this._refCounter, '__admin__', increment); | ||
// Increment counter for according to auth type because function might use event.data.ref | ||
// Increment counter according to auth type because function might use event.data.ref | ||
_.update(this._refCounter, this._appName(auth), increment); | ||
@@ -111,8 +102,10 @@ }; | ||
}; | ||
_.update(this._refCounter, '__admin__', decrement); | ||
_.update(this._refCounter, this._appName(auth), decrement); | ||
_.forEach(this._refCounter, function (count, key) { | ||
if (count === 0) { | ||
_this._waitToDestroyApp(key); | ||
} | ||
return delay(apps.garbageCollectionInterval).then(function () { | ||
_.update(_this._refCounter, '__admin__', decrement); | ||
_.update(_this._refCounter, _this._appName(auth), decrement); | ||
_.forEach(_this._refCounter, function (count, key) { | ||
if (count <= 0) { | ||
_this._destroyApp(key); | ||
} | ||
}); | ||
}); | ||
@@ -119,0 +112,0 @@ }; |
{ | ||
"name": "firebase-functions", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "Firebase SDK for Cloud Functions", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77879
1731