Skip to content

Commit

Permalink
20230513 1419
Browse files Browse the repository at this point in the history
  • Loading branch information
yasutakatou authored May 13, 2023
1 parent b6edf58 commit 14dcfe0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions IMS.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func main() {
_reacji := flag.Bool("reacji", false, "[-reacji=Slack: reacji channeler mode (true is enable)]")
_reminder := flag.Int("reminder", 30, "[-reminder=Interval for posting reminders (Seconds). ]")
_clearReminder := flag.Bool("clearReminder", false, "[-clearReminder=clear reminder channel and exit mode.]")
_noincident := flag.Bool("noincident", false, "[-noincident=No incident management mode.]")
_noreminder := flag.Bool("noreminder", false, "[-noreminder=No-reminder mode.]")

flag.Parse()

Expand Down Expand Up @@ -161,16 +163,20 @@ func main() {

ruleChecker(api, *_reverse)

go func() {
for {
time.Sleep(time.Second * time.Duration(*_reminder))
reminderPost(api, *_reverse)
}
}()
if *_noreminder == false {
go func() {
for {
time.Sleep(time.Second * time.Duration(*_reminder))
reminderPost(api, *_reverse)
}
}()
}

for {
incident(api, *_verbose, *_reverse)
time.Sleep(time.Hour * time.Duration(*_loop))
if *_noincident == false {
incident(api, *_verbose, *_reverse)
time.Sleep(time.Hour * time.Duration(*_loop))
}
}
os.Exit(0)
}
Expand Down

0 comments on commit 14dcfe0

Please sign in to comment.