Skip to content

Commit

Permalink
remove: 1 second sleep when HQ feed is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinB committed Aug 23, 2024
1 parent c7df161 commit 64258e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions internal/pkg/crawl/hq.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (c *Crawl) HQConsumer() {
// This is on purpose evaluated every time,
// because the value of workers will maybe change
// during the crawl in the future (to be implemented)
var HQBatchSize = int(math.Ceil(float64(c.Workers.Count)))
var HQBatchSize = int(c.Workers.Count)

if c.Finished.Get() {
c.Log.Error("crawl finished, stopping HQ consumer")
Expand All @@ -173,10 +173,6 @@ func (c *Crawl) HQConsumer() {
// get batch from crawl HQ
batch, err := c.HQClient.Feed(HQBatchSize, c.HQStrategy)
if err != nil {
if strings.Contains(err.Error(), "feed is empty") {
time.Sleep(time.Second)
}

c.Log.WithFields(c.genLogFields(err, nil, map[string]interface{}{
"batchSize": HQBatchSize,
"err": err,
Expand Down
5 changes: 5 additions & 0 deletions internal/pkg/upload/upload.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package upload

func UploadItem() {

}

0 comments on commit 64258e4

Please sign in to comment.