@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"medusa-telemetry": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix incorrect import
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import path from "path"
|
|
||||||
import Configstore from "configstore"
|
import Configstore from "configstore"
|
||||||
|
import path from "path"
|
||||||
|
|
||||||
import InMemConfig from "./util/in-memory-config"
|
import { InMemoryConfigStore } from "./util/in-memory-config"
|
||||||
import OutboxStore from "./util/outbox-store"
|
|
||||||
import isTruthy from "./util/is-truthy"
|
import isTruthy from "./util/is-truthy"
|
||||||
|
import OutboxStore from "./util/outbox-store"
|
||||||
|
|
||||||
class Store {
|
class Store {
|
||||||
constructor() {
|
constructor() {
|
||||||
try {
|
try {
|
||||||
this.config_ = new Configstore(`medusa`, {}, { globalConfigPath: true })
|
this.config_ = new Configstore(`medusa`, {}, { globalConfigPath: true })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.config_ = new InMemConfig()
|
this.config_ = new InMemoryConfigStore()
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseDir = path.dirname(this.config_.path)
|
const baseDir = path.dirname(this.config_.path)
|
||||||
@@ -37,11 +37,11 @@ class Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async flushEvents(handler) {
|
async flushEvents(handler) {
|
||||||
return await this.outbox_.startFlushEvents(async eventData => {
|
return await this.outbox_.startFlushEvents(async (eventData) => {
|
||||||
const events = eventData
|
const events = eventData
|
||||||
.split(`\n`)
|
.split(`\n`)
|
||||||
.filter(e => e && e.length > 2)
|
.filter((e) => e && e.length > 2)
|
||||||
.map(e => JSON.parse(e))
|
.map((e) => JSON.parse(e))
|
||||||
|
|
||||||
return await handler(events)
|
return await handler(events)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user