Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

g8rswimmer
Copy link
Owner

@Guitarbum722 please look this over before I add the unit tests

Copy link
Collaborator

@Guitarbum722 Guitarbum722 left a 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

func (s *Refresher) Shutdown() {
close(s.stop)
}
func (s *Refresher) refresh() error {
Copy link
Collaborator

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?

// 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")
Copy link
Collaborator

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?

time.Sleep(sleep)
if err := refresher.refresh(); err != nil {
refresher.err = err
sleep = 5 * time.Second
Copy link
Collaborator

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?

Copy link
Owner Author

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?

Copy link
Owner Author

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)

@serg-kovalev
Copy link

@g8rswimmer @Guitarbum722 do you guys still aim to merge it?
seems to be this package needs more love and support
Great job so far, any plans to maintain it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants