Skip to content

Commit f491d25

Browse files
committed
2 parents 79ea23f + 5a5989d commit f491d25

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/adapters/controllers/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const initCache = () => {
5050

5151
async function loadModelInstances () {
5252
console.time(label)
53-
await Promise.allSettled(specs.map(async m => m.fn()))
53+
await Promise.allSettled(specs.map(async m => m && m.fn ? m.fn() : false))
5454
console.timeEnd(label)
5555
}
5656

src/domain/undo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default async function compensate (model) {
2626
try {
2727
const portFlow = model.getPortFlow()
2828
const ports = model.getPorts()
29-
const undoAttempts = portFlow
29+
let undoAttempts = portFlow
3030
.map(port => ({ [port]: 0 }))
3131
.reduce((a, b) => ({ ...a, ...b }), {})
3232

src/domain/use-cases/invoke-port.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ export default function makeInvokePort ({
3737
} else {
3838
try {
3939
const { id = null, port, args } = input
40-
const model = id
40+
const model = typeof(id) === undefined
4141
? await repository.find(id)
4242
: await models.createModel(broker, repository, modelName, args)
4343

4444
if (!model) throw new Error('no such id')
4545

4646
const callback = model.getPorts()[port].callback || (x => x)
47-
return await model[port](input, callback)
47+
return await model[port](input,callback)
4848
} catch (error) {
4949
return new Error(error)
5050
}

0 commit comments

Comments
 (0)