-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for retries on extractor error #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only minor change requested.
Was checking retries in diff --git a/plugins/extractors/caramlstore/caramlstore.go b/plugins/extractors/caramlstore/caramlstore.go
index 8e1259b..3f16078 100644
--- a/plugins/extractors/caramlstore/caramlstore.go
+++ b/plugins/extractors/caramlstore/caramlstore.go
@@ -88,8 +88,6 @@ func (e *Extractor) Init(ctx context.Context, config plugins.Config) error {
// Extract checks if the table is valid and extracts the table schema
func (e *Extractor) Extract(ctx context.Context, emit plugins.Emit) error {
- defer e.client.Close()
-
projects, err := e.client.Projects(ctx)
if err != nil {
if shouldRetry(err) {
@@ -136,6 +134,10 @@ func (e *Extractor) Extract(ctx context.Context, emit plugins.Emit) error {
return nil
}
+func (e *Extractor) Close() error {
+ return e.client.Close()
+}
+
func shouldRetry(err error) bool {
switch utils.StatusCode(err) {
case codes.Canceled,
|
Co-authored-by: Suhas Karanth <sudo-suhas@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related to raystack#449