File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 96
96
var err error
97
97
var hadRows bool
98
98
99
+ windowProcessingStartTime := time .Now ()
100
+
99
101
if compareTimeuuid (wnd .begin , wnd .end ) < 0 {
100
102
var iter * changeRowIterator
101
103
iter , err = crq .queryRange (wnd .begin , wnd .end )
@@ -130,7 +132,10 @@ outer:
130
132
delay = sbr .config .Advanced .PostEmptyQueryDelay
131
133
}
132
134
133
- delayUntil := time .Now ().Add (delay )
135
+ delayUntil := windowProcessingStartTime .Add (delay )
136
+ if time .Until (delayUntil ) < time .Duration (0 ) {
137
+ sbr .config .Logger .Printf ("the stream can't keep up! the next poll was supposed to happen %v ago" , - time .Until (delayUntil ))
138
+ }
134
139
135
140
if sbr .reachedEndOfTheGeneration (wnd .begin ) {
136
141
break outer
@@ -141,7 +146,7 @@ outer:
141
146
select {
142
147
case <- ctx .Done ():
143
148
return ctx .Err ()
144
- case <- time .After (delayUntil . Sub ( time .Now () )):
149
+ case <- time .After (time .Until ( delayUntil )):
145
150
break delay
146
151
case <- sbr .interruptCh :
147
152
if sbr .reachedEndOfTheGeneration (wnd .begin ) {
You can’t perform that action at this time.
0 commit comments