Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Push more functionality into model.User #120

Closed
hferentschik opened this issue Feb 19, 2018 · 2 comments
Closed

Push more functionality into model.User #120

hferentschik opened this issue Feb 19, 2018 · 2 comments

Comments

@hferentschik
Copy link
Contributor

hferentschik commented Feb 19, 2018

User has some methods like HasActiveBuilds and HasBuilds, but at the same time we do something like this in conditions:

u.DoneBuild.Status.CompletionTimestamp.Time.Add(c.idleAfter).Before(time.Now()) 

It would be nice to pull this into the User. Something like LastestBuildCompletionOlderThanIdleTime(idleTime).

Similar:

 b.JenkinsLastUpdate.Add(c.idleAfter).Before(time.Now()) 

This should also allow to add some unit tests around these conditions.

@hferentschik
Copy link
Contributor Author

This issue relates to issue #143 and I think we need to restructure the whole model.User struct. We should be able to keep actually lest state than we do right now. In terms of the Idler, we don't need all the information we try to keep track of and there is a risk that is gets outdated.

@hferentschik
Copy link
Contributor Author

Closing this issue in favour of #143 which also will entail a rewrite/change of model.User.

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

No branches or pull requests

1 participant