public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
* Possible error in documentation regarding calls
@ 2021-07-19 0:26 Shawn K. Quinn
2021-07-19 7:59 ` Sergey Matveev
0 siblings, 1 reply; 2+ messages in thread
From: Shawn K. Quinn @ 2021-07-19 0:26 UTC (permalink / raw)
To: nncp-devel
The documentation has this example syntax for a calls structure:
calls: [
{
cron: "*/1 * * * MON-FRI"
onlinedeadline: 3600
nice: PRIORITY+10
autotoss: true
autotoss-doseen: true
},
(... lines omitted here for brevity ...)
{
cron: "*/5 * * * * * *"
when-tx-exists: true
nock: true
mcd-ignore: true
},
]
The last comma after the last brace and before the last bracket should
not be there from my experience. This was a very difficult configuration
issue to chase down, especially given that it came from following an
example in the documentation.
--
Shawn K. Quinn <skquinn@rushpost•com>
http://www.rantroulette.com
http://www.skqrecordquest.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Possible error in documentation regarding calls
2021-07-19 0:26 Possible error in documentation regarding calls Shawn K. Quinn
@ 2021-07-19 7:59 ` Sergey Matveev
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matveev @ 2021-07-19 7:59 UTC (permalink / raw)
To: nncp-devel
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
Greetings!
*** Shawn K. Quinn [2021-07-18 19:26]:
>The last comma after the last brace and before the last bracket should
>not be there from my experience. This was a very difficult configuration
>issue to chase down, especially given that it came from following an
>example in the documentation.
Honestly I do not understand or can not reproduce any kind of problems
with it. I literally can take calls structure from
http://www.nncpgo.org/Call.html save to file, convert from Hjson->JSON
and pretty print it:
$ cat > foo.hjson <<EOF
[copied from the site]
EOF
$ hjson-cli -c < foo.hjson | gojq
{
"calls": [
{
"autotoss": true,
"autotoss-doseen": true,
"cron": "*/1 * * * MON-FRI",
"nice": "PRIORITY+10",
"onlinedeadline": 3600
},
{
"cron": "30 * * * SAT,SUN",
"maxonlinetime": 1750,
"nice": "NORMAL",
"onlinedeadline": 1800,
"rxrate": 10,
"txrate": 20
},
{
"addr": "lan",
"cron": "0 * * * SAT,SUN",
"xx": "rx"
},
{
"cron": "*/5 * * * * * *",
"mcd-ignore": true,
"nock": true,
"when-tx-exists": true
}
]
}
I do not see any loss. Pay attention that NNCP's configuration file is
Hjson, not an ordinary JSON. Hjson contains "allow trailing commas"
example on https://hjson.org/. Moreover, actually all those commas can
be completely ommitited and I will remove them from documentation at all.
--
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263 6422 AE1A 8109 E498 57EF
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-19 7:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 0:26 Possible error in documentation regarding calls Shawn K. Quinn
2021-07-19 7:59 ` Sergey Matveev