-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(website): Only count latest versions for stats on main page #2814
Conversation
Nevermind, I missed that getRecent only counts version 1s anyways |
I tested that this is working and I now believe there are (almost) no edge cases 🥳 |
@@ -49,7 +50,8 @@ const getTotalAndLastUpdatedAt = async ( | |||
const client = LapisClient.createForOrganism(organism); | |||
return ( | |||
await client.call('aggregated', { | |||
version: 1, | |||
[VERSION_STATUS_FIELD]: siloVersionStatuses.latestVersion, |
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.
Maybe we should rename the function to getTotalUnrevokedAndLastUpdatedAt
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.
Personally I think this is ok as is (but I can live with the other option too)
@@ -67,12 +69,22 @@ const getTotalAndLastUpdatedAt = async ( | |||
const getRecent = async (organism: string, numberDaysAgo: number): Promise<number> => { | |||
const recentTimestamp = Math.floor(Date.now() / 1000 - numberDaysAgo * 24 * 60 * 60); | |||
const client = LapisClient.createForOrganism(organism); | |||
return ( | |||
const recentTotal = ( |
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.
recentTotalIncludingRevoked
Also some slight tweaks to function names in organism statistics, follow up to #2814
* refactor(website): rename `siloVersionStatus` to `versionStatus` Also some slight tweaks to function names in organism statistics, follow up to #2814 Coauthered by Theo
https://only-count-latest-version.loculus.org/