Permalink
Browse files

Minor. Fix resource init.

  • Loading branch information...
vlad-alexandru-ionescu committed Jun 8, 2016
1 parent d755bd4 commit 6eb3a2cca3b5e1e5ddb5efc91ae1cd160f8970af
Showing with 18 additions and 15 deletions.
  1. +6 −4 examples/notesAppJS/notesBackend/backend.js
  2. +12 −11 hostman/leverinstance.go
@@ -6,7 +6,7 @@ const lodash = require('lodash');
const mongoUrl = 'mongodb://172.17.0.1:27017/notesApp'
module.exports.addNote = (note, callback) => {
function addNote(note, callback) {
getDb((err, db) => {
if (err) {
callback(err);
@@ -25,9 +25,10 @@ module.exports.addNote = (note, callback) => {
callback(null, null);
});
});
};
}
module.exports.addNote = addNote;
module.exports.getNotes = (callback) => {
function getNotes(callback) {
getDb((err, db) => {
if (err) {
callback(err);
@@ -47,7 +48,8 @@ module.exports.getNotes = (callback) => {
callback(null, notes);
});
});
};
}
module.exports.getNotes = getNotes;
let cachedDb = null;
function getDb(callback) {
View
@@ -63,17 +63,18 @@ func NewLeverInstance(
"leverInstanceID", info.InstanceID,
)
instance := &LeverInstance{
leverEnv: info.Environment,
instanceID: info.InstanceID,
leverService: info.Service,
containerID: info.ContainerID,
servingID: info.ServingID,
instanceAddr: instanceAddr,
conns: conns,
docker: docker,
expiryDur: expiryDur,
onCloseFun: onCloseFun,
logger: logger,
leverEnv: info.Environment,
instanceID: info.InstanceID,
leverService: info.Service,
containerID: info.ContainerID,
servingID: info.ServingID,
instanceAddr: instanceAddr,
conns: conns,
docker: docker,
expiryDur: expiryDur,
onCloseFun: onCloseFun,
logger: logger,
leverResources: make(map[string]*LeverResource),
}
instance.expiryTimer = time.AfterFunc(expiryDur, instance.onExpired)
instance.registerAsService(proxyInAddr)

0 comments on commit 6eb3a2c

Please sign in to comment.