fix(medusa-telemetry): Fix incorrect import (#2574)

Duplicate of #2126
This commit is contained in:
Oliver Windall Juhl
2022-11-09 16:51:37 +00:00
committed by GitHub
parent 7b0ceeffb4
commit cfb24d72fa
2 changed files with 12 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"medusa-telemetry": patch
---
Fix incorrect import
+7 -7
View File
@@ -1,16 +1,16 @@
import path from "path"
import Configstore from "configstore"
import path from "path"
import InMemConfig from "./util/in-memory-config"
import OutboxStore from "./util/outbox-store"
import { InMemoryConfigStore } from "./util/in-memory-config"
import isTruthy from "./util/is-truthy"
import OutboxStore from "./util/outbox-store"
class Store {
constructor() {
try {
this.config_ = new Configstore(`medusa`, {}, { globalConfigPath: true })
} catch (e) {
this.config_ = new InMemConfig()
this.config_ = new InMemoryConfigStore()
}
const baseDir = path.dirname(this.config_.path)
@@ -37,11 +37,11 @@ class Store {
}
async flushEvents(handler) {
return await this.outbox_.startFlushEvents(async eventData => {
return await this.outbox_.startFlushEvents(async (eventData) => {
const events = eventData
.split(`\n`)
.filter(e => e && e.length > 2)
.map(e => JSON.parse(e))
.filter((e) => e && e.length > 2)
.map((e) => JSON.parse(e))
return await handler(events)
})