backwards bool in main

master v0.1.9
Bel LaPointe 2023-03-28 11:19:53 -06:00
parent 95810d3735
commit 7f2e25458e
2 changed files with 10 additions and 2 deletions

View File

@ -11,6 +11,14 @@ import (
func main() {
ctx, can := signal.NotifyContext(context.Background(), syscall.SIGINT)
defer can()
defer func() {
if err := recover(); err != nil {
log.Println("panic:", err)
panic(err)
}
}()
if err := src.Main(ctx); err != nil && ctx.Err() == nil {
panic(err)
}

View File

@ -17,9 +17,9 @@ func Main(ctx context.Context) error {
defer reader.Close()
interval := time.Millisecond * 50
if intervalS := os.Getenv("MAIN_INTERVAL_DURATION"); intervalS != "" {
if intervalS := os.Getenv("MAIN_INTERVAL_DURATION"); intervalS == "" {
} else if v, err := time.ParseDuration(intervalS); err != nil {
panic(err)
return err
} else {
interval = v
}