Skip to content

Instantly share code, notes, and snippets.

@seven-cd
Created June 5, 2017 12:03
Show Gist options
  • Save seven-cd/d9584b22d0018be278eab83305c0f249 to your computer and use it in GitHub Desktop.
Save seven-cd/d9584b22d0018be278eab83305c0f249 to your computer and use it in GitHub Desktop.
getContainers(params, meta) {
let query = resourceQueries.loadQuery('selectContainers');
let connection;
return dbConnect.getConnectionAsync().then((dbConnection) => {
connection = dbConnection;
return connection.queryAsync(query, params).then((result) => {
return resourceParser.parseContainersFromDb(result);
});
}).catch((exception) => {
cmsLogger.error(exception);
throw new Exception(exception.code);
}).finally(() => {
if (connection) connection.release();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment