mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
Update building scripts to latest master
Change-type: patch Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
This commit is contained in:
parent
fc1c1b402b
commit
24a83260ca
@ -50,16 +50,28 @@ resinCorvus.install({
|
|||||||
|
|
||||||
let mixpanelSample = DEFAULT_PROBABILITY
|
let mixpanelSample = DEFAULT_PROBABILITY
|
||||||
|
|
||||||
getConfig(configUrl)
|
/**
|
||||||
.then((config) => {
|
* @summary Init analytics configurations
|
||||||
|
* @example initConfig()
|
||||||
|
*/
|
||||||
|
const initConfig = async () => {
|
||||||
|
let validatedConfig = null
|
||||||
|
try {
|
||||||
|
const config = await getConfig(configUrl)
|
||||||
const mixpanel = _.get(config, [ 'analytics', 'mixpanel' ], {})
|
const mixpanel = _.get(config, [ 'analytics', 'mixpanel' ], {})
|
||||||
const probability = mixpanel.probability || DEFAULT_PROBABILITY
|
mixpanelSample = mixpanel.probability || DEFAULT_PROBABILITY
|
||||||
mixpanelSample = probability
|
if (isClientEligible(mixpanelSample)) {
|
||||||
const validatedConfig = isClientEligible(probability) ? validateMixpanelConfig(mixpanel) : null
|
validatedConfig = validateMixpanelConfig(mixpanel)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
resinCorvus.logException(err)
|
||||||
|
}
|
||||||
resinCorvus.setConfigs({
|
resinCorvus.setConfigs({
|
||||||
mixpanel: validatedConfig
|
mixpanel: validatedConfig
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
|
initConfig()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Get etcher configs stored online
|
* @summary Get etcher configs stored online
|
||||||
@ -129,10 +141,7 @@ exports.logDebug = resinCorvus.logDebug
|
|||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
exports.logEvent = (message, data) => {
|
exports.logEvent = (message, data) => {
|
||||||
const sessionData = {
|
resinCorvus.logEvent(message, { ...data, sample: mixpanelSample })
|
||||||
mixpanelSample
|
|
||||||
}
|
|
||||||
resinCorvus.logEvent(message, { ...data, sessionData })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 481cacb7f1533985507c84f28940cada0fb109e5
|
Subproject commit c80a0d906ffbfcac7d5490b8daf02d528d4a87aa
|
Loading…
x
Reference in New Issue
Block a user