Remove appdb.getBySubdomain()
This commit is contained in:
17
src/appdb.js
17
src/appdb.js
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
exports = module.exports = {
|
exports = module.exports = {
|
||||||
get: get,
|
get: get,
|
||||||
getBySubdomain: getBySubdomain,
|
|
||||||
getByHttpPort: getByHttpPort,
|
getByHttpPort: getByHttpPort,
|
||||||
getByContainerId: getByContainerId,
|
getByContainerId: getByContainerId,
|
||||||
add: add,
|
add: add,
|
||||||
@@ -114,22 +113,6 @@ function get(id, callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBySubdomain(subdomain, callback) {
|
|
||||||
assert.strictEqual(typeof subdomain, 'string');
|
|
||||||
assert.strictEqual(typeof callback, 'function');
|
|
||||||
|
|
||||||
database.query('SELECT ' + APPS_FIELDS_PREFIXED + ','
|
|
||||||
+ 'GROUP_CONCAT(CAST(appPortBindings.hostPort AS CHAR(6))) AS hostPorts, GROUP_CONCAT(appPortBindings.environmentVariable) AS environmentVariables'
|
|
||||||
+ ' FROM apps LEFT OUTER JOIN appPortBindings ON apps.id = appPortBindings.appId WHERE location = ? GROUP BY apps.id', [ subdomain ], function (error, result) {
|
|
||||||
if (error) return callback(new DatabaseError(DatabaseError.INTERNAL_ERROR, error));
|
|
||||||
if (result.length === 0) return callback(new DatabaseError(DatabaseError.NOT_FOUND));
|
|
||||||
|
|
||||||
postProcess(result[0]);
|
|
||||||
|
|
||||||
callback(null, result[0]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getByHttpPort(httpPort, callback) {
|
function getByHttpPort(httpPort, callback) {
|
||||||
assert.strictEqual(typeof httpPort, 'number');
|
assert.strictEqual(typeof httpPort, 'number');
|
||||||
assert.strictEqual(typeof callback, 'function');
|
assert.strictEqual(typeof callback, 'function');
|
||||||
|
|||||||
Reference in New Issue
Block a user