Commit 016c6df49758e5db4d0f3caaf955ad714e137afc
nitpick
wanderer committed on 7/6/2017, 12:52:56 AMParent: 979a3baec32a154440a1d6bb659f2130326a0c4f
Files changed
index.js | changed |
kernel.js | changed |
portManager.js | changed |
index.js | ||
---|---|---|
@@ -108,12 +108,11 @@ | ||
108 | 108 | // save the container in the state |
109 | 109 | await this.graph.set(this.state, idHash, state) |
110 | 110 | // create the container instance |
111 | 111 | const instance = await this._loadInstance(idHash) |
112 | - | |
113 | 112 | resolve(instance) |
114 | 113 | // send the intialization message |
115 | - instance.initialize(message) | |
114 | + await instance.initialize(message) | |
116 | 115 | |
117 | 116 | return instance |
118 | 117 | } |
119 | 118 |
kernel.js | ||
---|---|---|
@@ -51,12 +51,9 @@ | ||
51 | 51 | // check if the ports are saturated, if so we don't have to wait on the |
52 | 52 | // scheduler |
53 | 53 | const message = await this.ports.getNextMessage() |
54 | 54 | |
55 | - if (!message) { | |
56 | - // if no more messages then shut down | |
57 | - this.hypervisor.scheduler.done(this.id) | |
58 | - } else { | |
55 | + if (message) { | |
59 | 56 | message.fromPort.messages.shift() |
60 | 57 | // if the message we recived had more ticks then we currently have the |
61 | 58 | // update it |
62 | 59 | if (message._fromTicks > this.ticks) { |
@@ -64,8 +61,11 @@ | ||
64 | 61 | this.hypervisor.scheduler.update(this) |
65 | 62 | } |
66 | 63 | // run the next message |
67 | 64 | return this.run(message) |
65 | + } else { | |
66 | + // if no more messages then shut down | |
67 | + this.hypervisor.scheduler.done(this.id) | |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
portManager.js | ||
---|---|---|
@@ -112,9 +112,9 @@ | ||
112 | 112 | this._unboundPorts.forEach(port => { |
113 | 113 | this.kernel.send(port, new DeleteMessage()) |
114 | 114 | }) |
115 | 115 | this._unboundPorts.clear() |
116 | - if (Object.keys(this.ports).length === 0) { | |
116 | + if (!Object.keys(this.ports).length) { | |
117 | 117 | this.hypervisor.addNodeToCheck(this.id) |
118 | 118 | } |
119 | 119 | } |
120 | 120 |
Built with git-ssb-web