"log"
"os"
"path/filepath"
+ "time"
- "go.cypherpunks.ru/nncp/v6"
+ "go.cypherpunks.ru/nncp/v8"
)
func usage() {
func main() {
var (
nock = flag.Bool("nock", false, "Process .nock files")
+ cycle = flag.Uint("cycle", 0, "Repeat check after N seconds in infinite loop")
cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file")
nodeRaw = flag.String("node", "", "Process only that node")
spoolPath = flag.String("spool", "", "Override path to spool")
}
}
+Cycle:
isBad := false
for nodeId, node := range ctx.Neigh {
if nodeOnly != nil && nodeId != *nodeOnly.Id {
}
if *nock {
for job := range ctx.JobsNoCK(node.Id) {
- if _, err = ctx.CheckNoCK(node.Id, job.HshValue); err != nil {
+ if _, err = ctx.CheckNoCK(node.Id, job.HshValue, nil); err != nil {
pktName := nncp.Base32Codec.EncodeToString(job.HshValue[:])
log.Println(filepath.Join(
ctx.Spool,
isBad = true
}
}
+ if *cycle > 0 {
+ time.Sleep(time.Duration(*cycle) * time.Second)
+ goto Cycle
+ }
if isBad {
os.Exit(1)
}