Skip to content

Commit 5a298a0

Browse files
committed
v3.17.0
1 parent 5e69d0e commit 5a298a0

8 files changed

Lines changed: 313 additions & 292 deletions

File tree

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.17.0 2019-10-01
2+
3+
* Fix: use internal.print function fully throughout code base.
4+
* `close` method waits for one action execution interval before preceding to avoid missing pending actions.
5+
6+
17
## 3.16.1 2019-09-30
28

39
* Option `internal.print.log|err` allows custom printing of console output.

lib/print.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ module.exports.plugin_options = function plugin_options(
5959
plugin_options
6060
) {
6161
instance.private$.print.log(
62-
'\nSeneca Options (' + instance.id + '): plugin: ' + fullname + '\n' + '===\n'
62+
'\nSeneca Options (' +
63+
instance.id +
64+
'): plugin: ' +
65+
fullname +
66+
'\n' +
67+
'===\n'
6368
)
6469
instance.private$.print.log(Util.inspect(plugin_options, { depth: null }))
6570
instance.private$.print.log('')

lib/ready.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ function api_ready(ready_func) {
2525

2626
// Allow pending actions to complete
2727
// TODO: get interval from GateExecutor
28-
setTimeout(run_ready,self.private$.ge.options.interval)
29-
30-
function run_ready() {
28+
setTimeout(run_ready, self.private$.ge.options.interval)
3129

30+
function run_ready() {
3231
if ('function' === typeof ready_func) {
3332
var private$ = self.root.private$
3433

@@ -37,11 +36,11 @@ function api_ready(ready_func) {
3736
}
3837

3938
var ready_name =
40-
(null == ready_func.name ||
41-
'' === ready_func.name ||
42-
'ready' === ready_func.name
43-
? 'ready_'
44-
: ready_func.name + '_ready_') + private$.next_ready_id()
39+
(null == ready_func.name ||
40+
'' === ready_func.name ||
41+
'ready' === ready_func.name
42+
? 'ready_'
43+
: ready_func.name + '_ready_') + private$.next_ready_id()
4544

4645
Object.defineProperty(ready_call, 'name', { value: ready_name })
4746

@@ -52,7 +51,7 @@ function api_ready(ready_func) {
5251
}
5352
}
5453
}
55-
54+
5655
return self
5756
}
5857

package-lock.json

Lines changed: 269 additions & 269 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "seneca",
33
"description": "A Microservices Framework for Node.js",
4-
"version": "3.16.1",
4+
"version": "3.17.0",
55
"license": "MIT",
66
"homepage": "http://senecajs.org",
77
"keywords": [

test/private.test.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,42 @@ const Seneca = require('..')
1111

1212
lab.describe('private', function() {
1313
lab.test('exit_close', async () => {
14-
var tmp = {exit:0}
15-
var opts = {system:{exit:()=>{tmp.exit++}}}
14+
var tmp = { exit: 0 }
15+
var opts = {
16+
system: {
17+
exit: () => {
18+
tmp.exit++
19+
}
20+
}
21+
}
1622

17-
var si0 = Seneca(opts).use('promisify').test()
23+
var si0 = Seneca(opts)
24+
.use('promisify')
25+
.test()
1826
si0.private$.exit_close()
1927
await si0.ready()
2028
expect(tmp.exit).equal(1)
2129

22-
23-
var si1 = Seneca(opts).use('promisify').test()
30+
var si1 = Seneca(opts)
31+
.use('promisify')
32+
.test()
2433
si1.add('role:seneca,cmd:close', function(msg, reply) {
2534
tmp.si1 = true
26-
this.prior(msg,reply)
35+
this.prior(msg, reply)
2736
})
2837
si1.private$.exit_close()
2938
await si1.ready()
30-
expect(tmp).equal({exit:2,si1:true})
31-
32-
var si2 = Seneca(opts).use('promisify').test()
39+
expect(tmp).equal({ exit: 2, si1: true })
40+
41+
var si2 = Seneca(opts)
42+
.use('promisify')
43+
.test()
3344
si2.add('role:seneca,cmd:close', function(msg, reply) {
3445
tmp.si2 = true
3546
throw new Error('si2')
3647
})
3748
si2.private$.exit_close()
3849
await si2.ready()
39-
expect(tmp).equal({exit:3,si1:true,si2:true})
50+
expect(tmp).equal({ exit: 3, si1: true, si2: true })
4051
})
4152
})

test/ready.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('ready', function() {
4444
fin()
4545
}
4646
},
47-
47+
4848
debug: { undead: true }
4949
})
5050

test/seneca.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('seneca', function() {
8585
Package.version +
8686
'"}'
8787
)
88-
expect(Util.inspect(si).replace(/\n */g,' ')).equal(
88+
expect(Util.inspect(si).replace(/\n */g, ' ')).equal(
8989
"{ isSeneca: true, id: 'a', did: undefined, fixedargs: {}, fixedmeta: undefined, start_time: 123, version: '" +
9090
Package.version +
9191
"' }"

0 commit comments

Comments
 (0)