Skip to content

Conversation

@zeripath
Copy link
Contributor

@zeripath zeripath commented Feb 6, 2021

Use the /user/events eventsource to update the stopwatches
instead of polling /api/v1/user/stopwatches if the eventsource
is enabled.

Signed-off-by: Andrew Thornton art27@cantab.net

Use the /user/events eventsource to update the stopwatches
instead of polling /api/v1/user/stopwatches if the eventsource
is enabled.

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 6, 2021
@zeripath zeripath added this to the 1.14.0 milestone Feb 6, 2021
case <-shutdownCtx.Done():
go unregister()
break loop
case <-stopwatchTimer.C:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a little more efficient and happen in the modules/eventsource instead per uid.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 6, 2021
@zeripath
Copy link
Contributor Author

zeripath commented Feb 6, 2021

I don't completely understand why this is polling in any case instead of looking for some change but moving the polling to /user/events will clean up the http log.

@6543 6543 added type/enhancement An improvement of existing functionality and removed type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Feb 10, 2021
@6543
Copy link
Member

6543 commented Feb 10, 2021

tested, if stopwatch is running with this patch the icon will disappear after a few seconds
local issue on my side

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor Author

actually I think it wasn't a local issue on your side - it was a real issue. I've fixed it now. Feel free to test again @6543

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can confirm that it now works smoothly

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 13, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 18, 2021
@6543
Copy link
Member

6543 commented Feb 19, 2021

🚀

@6543 6543 merged commit 0922998 into go-gitea:master Feb 19, 2021
@zeripath zeripath deleted the stopwatches-to-eventsource branch February 19, 2021 19:43
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants