Web instances: Add flags to enable unsafe extra features (#438)

This commit is contained in:
Simon Lecoq
2021-08-01 13:58:41 +02:00
committed by GitHub
parent 9e77a1b2c0
commit 3e26d375eb
8 changed files with 30 additions and 21 deletions

View File

@@ -21,6 +21,8 @@ Use a full `repo` scope token to access **private** events.
By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone (see [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of supported timezones) for accurate metrics.
> 🔣 On web instances, *recent languages activity* is an extra feature and must be enabled globally in `settings.json`
#### Examples workflows
[➡️ Available options for this plugin](metadata.yml)

View File

@@ -2,7 +2,7 @@
import { recent as recent_analyzer } from "./../languages/analyzers.mjs"
//Setup
export default async function({login, data, rest, imports, q, account}, {enabled = false, ...defaults} = {}) {
export default async function({login, data, rest, imports, q, account}, {enabled = false, extras = false, ...defaults} = {}) {
//Plugin execution
try {
//Check if plugin is enabled and requirements are met
@@ -97,7 +97,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
}
//Linguist
if (charts) {
if ((extras)&&(charts)) {
//Check if linguist exists
console.debug(`metrics/compute/${login}/plugins > habits > searching recently used languages using linguist`)
if (patches.length) {
@@ -109,7 +109,6 @@ export default async function({login, data, rest, imports, q, account}, {enabled
}
else
console.debug(`metrics/compute/${login}/plugins > habits > linguist not available`)
}
//Results