make-mp-data 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -188,22 +188,23 @@ async function main(config) {
|
|
|
188
188
|
|
|
189
189
|
// ! DATA GENERATION ENDS HERE
|
|
190
190
|
|
|
191
|
-
// Step 10:
|
|
191
|
+
// Step 10: Send to Mixpanel (if token provided)
|
|
192
|
+
// IMPORTANT: Must happen BEFORE flushing to disk, because flush() clears the arrays
|
|
193
|
+
let importResults;
|
|
194
|
+
if (validatedConfig.token) {
|
|
195
|
+
importResults = await sendToMixpanel(context);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Step 11: Flush lookup tables to disk (always as CSVs)
|
|
192
199
|
if (validatedConfig.writeToDisk) {
|
|
193
200
|
await flushLookupTablesToDisk(storage, validatedConfig);
|
|
194
201
|
}
|
|
195
202
|
|
|
196
|
-
// Step
|
|
203
|
+
// Step 12: Flush other storage containers to disk (if writeToDisk enabled)
|
|
197
204
|
if (validatedConfig.writeToDisk) {
|
|
198
205
|
await flushStorageToDisk(storage, validatedConfig);
|
|
199
206
|
}
|
|
200
207
|
|
|
201
|
-
// Step 12: Send to Mixpanel (if token provided)
|
|
202
|
-
let importResults;
|
|
203
|
-
if (validatedConfig.token) {
|
|
204
|
-
importResults = await sendToMixpanel(context);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
208
|
// Step 13: Compile results
|
|
208
209
|
jobTimer.stop(false);
|
|
209
210
|
const { start, end, delta, human } = jobTimer.report(false);
|