Display last retrieved day from event in recent languages instead #345

This commit is contained in:
lowlighter
2021-06-02 00:26:29 +02:00
parent 3daad25eb2
commit 5120f64c97
4 changed files with 5 additions and 1 deletions

View File

@@ -56,5 +56,7 @@ For better results, it's advised to add either your surnames and eventually no-r
plugin_languages_limit: 8 # Display up to 8 languages
plugin_languages_sections: most-used, recently-used # Display most used and recently used languages stats
plugin_languages_indepth: no # Get indepth stats (see documentation before enabling)
plugin_languages_recent_load: 500 # Load up to 500 events to compute recently used stats
plugin_languages_recent_days: 7 # Limit recently used stats to last week
commits_authoring: lowlighter@users.noreply.github.com # Surnames or email addresses used to identify your commits
```

View File

@@ -69,6 +69,7 @@ export async function recent({login, data, imports, rest, account}, {skipped, da
}
console.debug(`metrics/compute/${login}/plugins > languages > ${commits.length} commits loaded`)
results.commits = commits.length
results.latest = Math.round((new Date().getTime() - new Date(commits.slice(-1).shift()?.created_at).getTime()) / (1000 * 60 * 60 * 24))
//Retrieve edited files and filter edited lines (those starting with +/-) from patches
console.debug(`metrics/compute/${login}/plugins > languages > loading patches`)

View File

@@ -101,6 +101,7 @@ inputs:
# Filter events by age (for recently used languages statistics)
# Set to 0 to disable age filtering
# Note that metrics won't be able to load more events than GitHub is able to provide
plugin_languages_recent_days:
description: Maximum event age (for recently used section)
type: number