hotfix(medusa-plugin-contentful): Reuse Redis clients in Contentful plugin
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
import _ from "lodash"
|
import _ from "lodash"
|
||||||
import { BaseService } from "medusa-interfaces"
|
import { BaseService } from "medusa-interfaces"
|
||||||
import { createClient } from "contentful-management"
|
import { createClient } from "contentful-management"
|
||||||
import redis from "redis"
|
|
||||||
|
|
||||||
class ContentfulService extends BaseService {
|
class ContentfulService extends BaseService {
|
||||||
constructor(
|
constructor(
|
||||||
{ productService, productVariantService, eventBusService },
|
{ productService, redisClient, productVariantService, eventBusService },
|
||||||
options
|
options
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
@@ -22,9 +21,7 @@ class ContentfulService extends BaseService {
|
|||||||
accessToken: options.access_token,
|
accessToken: options.access_token,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.redis_ = redis.createClient({
|
this.redis_ = redisClient
|
||||||
url: options.redis_url,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getIgnoreIds_(type) {
|
async getIgnoreIds_(type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user