-
Notifications
You must be signed in to change notification settings - Fork 42
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
adding a session refershing object #41
base: master
Are you sure you want to change the base?
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.
just a few questions @g8rswimmer
session/refresh.go
Outdated
func (s *Refresher) Shutdown() { | ||
close(s.stop) | ||
} | ||
func (s *Refresher) refresh() 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.
do you want these receiver variables to be r
instead?
session/refresh.go
Outdated
// OpenRefresh will open the first session and set up a re-occuring refresh of the session token. | ||
func OpenRefresh(config sfdc.Configuration, refershTime int) (*Refresher, error) { | ||
if refershTime <= 0 { | ||
return nil, errors.New("session refresh: refresh time can not be less than zero") |
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.
this error message technically doesn't align with the logic - is < 1
sufficient?
session/refresh.go
Outdated
time.Sleep(sleep) | ||
if err := refresher.refresh(); err != nil { | ||
refresher.err = err | ||
sleep = 5 * time.Second |
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.
not sure I follow the 5 second hard-code here, can you explain?
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.
that was just a magic number, any suggestions?
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.
tried to handle with a user supplied struct (also added a default one because I am nice)
…al and error refresh periods
@g8rswimmer @Guitarbum722 do you guys still aim to merge it? |
@Guitarbum722 please look this over before I add the unit tests