hotfix(medusa-plugin-contentful): Reuse Redis clients in Contentful plugin

This commit is contained in:
olivermrbl
2020-12-16 12:29:32 +01:00
parent bb97a17fe3
commit a14578dbe4
@@ -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) {