Skip to content

lastFetch is set even if fetch fails #10

@marc-ste

Description

@marc-ste

In queue.go

// synchronously go fetch
e.lastFetch = time.Now()
res, err := q.fetch.fetch(ctx, e.request)
if err != nil {
    // Even if the request failed, we need to queue the next fetch
    q.enqueueNextFetch(nil, e)
    return fmt.Errorf(`failed to fetch %q: %w`, e.request.url, err)
}

If e.lastFetch is written before the fetch method finishes, it will be set regardless of the success of fetch(). This means that subsequent fetches don't try and fetch the object even if entry.data is nil.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions