Skip to content

Commit 387ba35

Browse files
authored
Fix log ID retrieval and adjust sleep duration in logs processing (#1314)
1 parent 74f8b29 commit 387ba35

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/cli/logs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func tailLogsCmd(cli *cli) *cobra.Command {
162162

163163
var lastLogID string
164164
if len(list) > 0 {
165-
lastLogID = list[len(list)-1].GetLogID()
165+
lastLogID = list[0].GetLogID()
166166
}
167167

168168
// Create a `set` to detect duplicates clientside.
@@ -193,14 +193,14 @@ func tailLogsCmd(cli *cli) *cobra.Command {
193193
return
194194
}
195195

196-
if len(list) > 0 {
196+
if len(list) > 1 {
197197
logsCh <- dedupeLogs(list, set)
198-
lastLogID = list[len(list)-1].GetLogID()
198+
lastLogID = list[0].GetLogID()
199199
}
200200

201201
if len(list) < logsPerPageLimit {
202202
// Not a lot is happening, sleep on it.
203-
time.Sleep(time.Second)
203+
time.Sleep(2 * time.Second)
204204
}
205205
}
206206
}(lastLogID)

0 commit comments

Comments
 (0)