File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -46,18 +46,18 @@ var (
4646 simulEnvironment * stream.Environment
4747)
4848
49- func checkTtl () {
50- if ttl > 0 {
49+ func checkRunDuration () {
50+ if runDuration > 0 {
5151 start := time .Now ()
52- ticker := time .NewTicker (1 * time .Minute )
52+ ticker := time .NewTicker (10 * time .Second )
5353 go func () {
5454 for {
5555 select {
5656 case _ = <- ticker .C :
57- v := time .Now ().Sub (start ).Minutes ()
58- if v >= float64 (ttl ) {
59- logInfo ("Closing due TTL" )
60- os .Exit (1 )
57+ v := time .Now ().Sub (start ).Seconds ()
58+ if v >= float64 (runDuration ) {
59+ logInfo ("Stopping after %s seconds" , runDuration )
60+ os .Exit (0 )
6161 }
6262 }
6363 }
@@ -165,7 +165,7 @@ func startSimulation() error {
165165 checkErr (err )
166166 }
167167 printStats ()
168- checkTtl ()
168+ checkRunDuration ()
169169
170170 return err
171171}
You can’t perform that action at this time.
0 commit comments