Merge branch 'master' into mq-subscribe

This commit is contained in:
chrislu
2024-04-25 23:42:19 -07:00
10 changed files with 79 additions and 62 deletions

View File

@@ -328,7 +328,7 @@ func ReadUrlAsStreamAuthenticated(fileUrl, jwt string, cipherKey []byte, isConte
}
defer CloseResponse(r)
if r.StatusCode >= 400 {
retryable = r.StatusCode == http.StatusNotFound || r.StatusCode >= 500
retryable = r.StatusCode == http.StatusNotFound || r.StatusCode >= 499
return retryable, fmt.Errorf("%s: %s", fileUrl, r.Status)
}

View File

@@ -66,9 +66,17 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition
isDone = true
return
}
logBuffer.RLock()
lastTsNs := logBuffer.LastTsNs
for lastTsNs == logBuffer.LastTsNs {
logBuffer.RUnlock()
loopTsNs := lastTsNs // make a copy
for lastTsNs == loopTsNs {
if waitForDataFn() {
// Update loopTsNs and loop again
logBuffer.RLock()
loopTsNs = logBuffer.LastTsNs
logBuffer.RUnlock()
continue
} else {
isDone = true