23
Comments (6)
sorted by:
You're viewing a single comment thread. View all comments, or full comment thread.
MAGAparty2020 (8 points)

Also, add a total subscriber counter and currently online count!!!

ruddagar (4 points)

That's got to be the most requested feature I've seen so far. I've seen some pedes say it's an easy add and others say it's tough. They'll get it eventually and we'll see how quickly it rises to over 7 million!

Liberaltearslmfao [S] (2 points)

It is easy.

Like 5 minutes to implement easy.

SELECT count(users) from users;

SELECT count(users) from users u Where u.lastOnlineDate between now And 10 minutes.

Then just cache the two numbers and run that sequel every 5 minutes.

Then, make a rest endpoint.

@GetMappings("api/users/count") Public ResponseEntity<Long> getMaxSubscribers() { Return ResponseEntity.ok().body(entity from sql above).build() }

The add a counter in the UI. <row> <label> total subscribers </label>

<div> {totalSubscribers} </div> </row>

And finally add the api call to the client web side.

Const totalSubscribers = this.getMaxSubscribers();

That's it. 5 minutes max.