Skip to content

feat(aggregator): Extract retry function parameters to a structure #1401

Description

@Oppen

These functions receive a lot of parameters and it is easy to get lost. I would refactor this to receive a struct instead with all the config. This will also make passing a default (which is what we are doing in most if not all retryable functions) much easier, as you would only pass one param and reuse the struct. I'll give you a hint:

typeRetryConfig {
MinDelay time.DurationMaxIntervaltime.DurationMaxDelaytime.DurationRetryFactorfloat64NumRetriesuint64
}
funcRetryWithData[Tany](functionToRetryfunc() (T,error), config*RetryConfig) { }
// The you would you use like so funcfoo() {
RetryWithData(funcToRetry, &RetryConfig{ RetryFactor: 5 , ...})
}

Originally posted by @MarcosNicolau in #1304 (comment)

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