use $MAIN_INTERVAL_DURATION
This commit is contained in:
10
src/main.go
10
src/main.go
@@ -5,13 +5,21 @@ import (
|
||||
"mayhem-party/src/device/input"
|
||||
"mayhem-party/src/device/output"
|
||||
"mayhem-party/src/device/output/key"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Main(ctx context.Context) error {
|
||||
reader := input.New()
|
||||
writer := output.New()
|
||||
c := time.NewTicker(time.Millisecond * 50)
|
||||
interval := time.Millisecond * 50
|
||||
if intervalS, ok := os.LookupEnv("MAIN_INTERVAL_DURATION"); !ok {
|
||||
} else if v, err := time.ParseDuration(intervalS); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
interval = v
|
||||
}
|
||||
c := time.NewTicker(interval)
|
||||
defer c.Stop()
|
||||
|
||||
block := func() bool {
|
||||
|
||||
Reference in New Issue
Block a user