mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +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
|
||||
|
||||
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 probability = mixpanel.probability || DEFAULT_PROBABILITY
|
||||
mixpanelSample = probability
|
||||
const validatedConfig = isClientEligible(probability) ? validateMixpanelConfig(mixpanel) : null
|
||||
resinCorvus.setConfigs({
|
||||
mixpanel: validatedConfig
|
||||
})
|
||||
mixpanelSample = mixpanel.probability || DEFAULT_PROBABILITY
|
||||
if (isClientEligible(mixpanelSample)) {
|
||||
validatedConfig = validateMixpanelConfig(mixpanel)
|
||||
}
|
||||
} catch (err) {
|
||||
resinCorvus.logException(err)
|
||||
}
|
||||
resinCorvus.setConfigs({
|
||||
mixpanel: validatedConfig
|
||||
})
|
||||
}
|
||||
|
||||
initConfig()
|
||||
|
||||
/**
|
||||
* @summary Get etcher configs stored online
|
||||
@ -129,10 +141,7 @@ exports.logDebug = resinCorvus.logDebug
|
||||
* });
|
||||
*/
|
||||
exports.logEvent = (message, data) => {
|
||||
const sessionData = {
|
||||
mixpanelSample
|
||||
}
|
||||
resinCorvus.logEvent(message, { ...data, sessionData })
|
||||
resinCorvus.logEvent(message, { ...data, sample: mixpanelSample })
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 481cacb7f1533985507c84f28940cada0fb109e5
|
||||
Subproject commit c80a0d906ffbfcac7d5490b8daf02d528d4a87aa
|
Loading…
x
Reference in New Issue
Block a user