From da8de173a6117fdfa4944d077ab1d31ba4e2b1d5 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 6 May 2016 14:52:33 +0200 Subject: [PATCH] Remove appdb.getBySubdomain() --- src/appdb.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/appdb.js b/src/appdb.js index 048335dc4..33a811240 100644 --- a/src/appdb.js +++ b/src/appdb.js @@ -4,7 +4,6 @@ exports = module.exports = { get: get, - getBySubdomain: getBySubdomain, getByHttpPort: getByHttpPort, getByContainerId: getByContainerId, 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) { assert.strictEqual(typeof httpPort, 'number'); assert.strictEqual(typeof callback, 'function');