-
Notifications
You must be signed in to change notification settings - Fork 0
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: restart connection changes #11
Conversation
7bd884d
to
7adfed8
Compare
7adfed8
to
8358840
Compare
8358840
to
55942ee
Compare
92c366e
to
51796e1
Compare
51796e1
to
466915a
Compare
31b57d5
to
af80f55
Compare
_ = r.client.Restart() | ||
|
||
//TODO: handle error |
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.
Por que no manejamos el error?
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.
deberiamos mandarlo a sentry o algo. Esto va a intentar hacer un restart N cantidad de attempts, si falla despues de los intentos lo va a retornar en execFunc
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.
Digo, no deberíamos omitir el error que devueve el r.client.Restart()
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.
se quito porque alli esta el dema del log de debug, tuvimos probelas de serializacion porque el cliente tiene la config que a si vez tiene una propiedad que no es serializable a json PrintFn
y esto generaba un panic en el framework. la idea es que pongamos un sistema de logging mas estandarizado como lo tiene por ejemplo gorm que es una interface independiente modificable.
7f628ca
to
3828e3e
Compare
qb/client.go
Outdated
return nil | ||
} | ||
|
||
func getSession(c models.Config) (*gocql.Session, error) { |
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.
Podemos ponerle createSession
?
getSession
me suena mas a un singleton
qb/client.go
Outdated
func NewClientWithSession(session *gocql.Session, conf models.Config) (Client, error) { | ||
c := &client{ | ||
session: session, | ||
config: conf, | ||
canRestart: false, | ||
} | ||
|
||
return c, nil | ||
} |
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.
func NewClientWithSession(session *gocql.Session, conf models.Config) (Client, error) { | |
c := &client{ | |
session: session, | |
config: conf, | |
canRestart: false, | |
} | |
return c, nil | |
} | |
func NewClientWithSession(session *gocql.Session, conf models.Config) Client { | |
return &client{ | |
session: session, | |
config: conf, | |
canRestart: false, | |
} | |
} |
3828e3e
to
f39ce44
Compare
qb/client.go
Outdated
func NewClientWithSession(session *gocql.Session, conf models.Config) (Client, error) { | ||
return &client{ | ||
session: session, | ||
config: conf, | ||
canRestart: false, | ||
}, nil | ||
} |
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.
func NewClientWithSession(session *gocql.Session, conf models.Config) (Client, error) { | |
return &client{ | |
session: session, | |
config: conf, | |
canRestart: false, | |
}, nil | |
} | |
func NewClientWithSession(session *gocql.Session, conf models.Config) Client { | |
return &client{ | |
session: session, | |
config: conf, | |
canRestart: false, | |
} | |
} |
qb/qcount/count_test.go
Outdated
t.Errorf("exp: test got: %v", q.table) | ||
return |
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.
t.Errorf("exp: test got: %v", q.table) | |
return | |
t.FatalF("exp: test got: %v", q.table) |
qb/qcount/count_test.go
Outdated
t.Errorf("exp: test2 got: %v", q.table) | ||
return |
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.
t.Errorf("exp: test2 got: %v", q.table) | |
return | |
t.FatalF("exp: test2 got: %v", q.table) |
qb/qinsert/insert_exec_test.go
Outdated
client := mocks.NewClient(t) | ||
|
||
q := New(client).Fields(test.fields...).Into(test.table).Values(test.values...) | ||
query := q.Build() |
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.
No te deja usarlo si es privado? Esta dentro del mismo paquete 🤔
f39ce44
to
7872a0a
Compare
7872a0a
to
f572221
Compare
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.
🥇
Description
Se implementa un wrapper donde se realiza un restart de la session si hay un fallo de tipo
gocql: no hosts available in the pool
y se vuelve a intentar ejecutar la query N cantidad de intentosTask Context
What is the current behavior?
What is the new behavior?
Additional Context
Checklist
How was it tested?
Updated services