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 (
46
46
simulEnvironment * stream.Environment
47
47
)
48
48
49
- func checkTtl () {
50
- if ttl > 0 {
49
+ func checkRunDuration () {
50
+ if runDuration > 0 {
51
51
start := time .Now ()
52
- ticker := time .NewTicker (1 * time .Minute )
52
+ ticker := time .NewTicker (10 * time .Second )
53
53
go func () {
54
54
for {
55
55
select {
56
56
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 )
61
61
}
62
62
}
63
63
}
@@ -165,7 +165,7 @@ func startSimulation() error {
165
165
checkErr (err )
166
166
}
167
167
printStats ()
168
- checkTtl ()
168
+ checkRunDuration ()
169
169
170
170
return err
171
171
}
You can’t perform that action at this time.
0 commit comments