-
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
Live viewer count #1037
Live viewer count #1037
Conversation
Your Testserver will be ready at https://1037.test.live.mm.rbg.tum.de in a few minutes. Logins
|
api/courses.go
Outdated
@@ -154,10 +155,14 @@ func (r coursesRoutes) getLive(c *gin.Context) { | |||
lectureHall = &lh | |||
} | |||
} | |||
|
|||
var stat model.Stat | |||
stat, err = r.StatisticsDao.GetStat(stream.ID) |
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.
We should be able to just get this number from memory. The length of the chat session contains the number of viewers: https://github.com/joschahenningsen/TUM-Live/blob/a1c9209f5a875eab2967035d742ecab0b2e56fac/api/chat.go#LL661C43-L661C43
Would this be easier to implement and more efficient?
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.
Definitely. 👍🏻 However, we need to make sure to update this if we ever shard and distribute the chat as in #889.
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.
Can you regenerate the mocks? Then this looks good to go!
* Add live view count * Fix tests * Use len(chat-sessions) instead of db query * Regenerate mocks
Motivation and Context
Resolves #1026
Description
Steps for Testing
/new
Screenshots