fix: make packages/medusa/src/services/idempotency-key.js pass linting (#568)
This commit is contained in:
1 parent
8e59ec81e4
commit
5b3c0c4471
2 files changed
+5
-7
No files matched your search
@@ -4,7 +4,6 @@
|
|||||||
/packages/medusa/src/services/claim-item.js
|
/packages/medusa/src/services/claim-item.js
|
||||||
/packages/medusa/src/services/event-bus.js
|
/packages/medusa/src/services/event-bus.js
|
||||||
/packages/medusa/src/services/fulfillment-provider.js
|
/packages/medusa/src/services/fulfillment-provider.js
|
||||||
/packages/medusa/src/services/idempotency-key.js
|
|
||||||
/packages/medusa/src/services/inventory.js
|
/packages/medusa/src/services/inventory.js
|
||||||
/packages/medusa/src/services/middleware.js
|
/packages/medusa/src/services/middleware.js
|
||||||
/packages/medusa/src/services/oauth.js
|
/packages/medusa/src/services/oauth.js
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { BaseService } from "medusa-interfaces"
|
import { BaseService } from "medusa-interfaces"
|
||||||
import { MedusaError } from "medusa-core-utils"
|
import { MedusaError } from "medusa-core-utils"
|
||||||
import { v4 } from "uuid"
|
import { v4 } from "uuid"
|
||||||
import IdempotencyKeyModel from "../models/idempotency-key"
|
|
||||||
|
|
||||||
const KEY_LOCKED_TIMEOUT = 1000
|
const KEY_LOCKED_TIMEOUT = 1000
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ class IdempotencyKeyService extends BaseService {
|
|||||||
* @return {Promise<IdempotencyKeyModel>} the existing or created idempotency key
|
* @return {Promise<IdempotencyKeyModel>} the existing or created idempotency key
|
||||||
*/
|
*/
|
||||||
async initializeRequest(headerKey, reqMethod, reqParams, reqPath) {
|
async initializeRequest(headerKey, reqMethod, reqParams, reqPath) {
|
||||||
return this.atomicPhase_(async _ => {
|
return this.atomicPhase_(async (_) => {
|
||||||
// If idempotency key exists, return it
|
// If idempotency key exists, return it
|
||||||
let key = await this.retrieve(headerKey)
|
let key = await this.retrieve(headerKey)
|
||||||
|
|
||||||
@@ -54,7 +53,7 @@ class IdempotencyKeyService extends BaseService {
|
|||||||
* @return {Promise<IdempotencyKeyModel>} the created idempotency key
|
* @return {Promise<IdempotencyKeyModel>} the created idempotency key
|
||||||
*/
|
*/
|
||||||
async create(payload) {
|
async create(payload) {
|
||||||
return this.atomicPhase_(async manager => {
|
return this.atomicPhase_(async (manager) => {
|
||||||
const idempotencyKeyRepo = manager.getCustomRepository(
|
const idempotencyKeyRepo = manager.getCustomRepository(
|
||||||
this.idempotencyKeyRepository_
|
this.idempotencyKeyRepository_
|
||||||
)
|
)
|
||||||
@@ -93,7 +92,7 @@ class IdempotencyKeyService extends BaseService {
|
|||||||
* @return {Promise} result of the update operation
|
* @return {Promise} result of the update operation
|
||||||
*/
|
*/
|
||||||
async lock(idempotencyKey) {
|
async lock(idempotencyKey) {
|
||||||
return this.atomicPhase_(async manager => {
|
return this.atomicPhase_(async (manager) => {
|
||||||
const idempotencyKeyRepo = manager.getCustomRepository(
|
const idempotencyKeyRepo = manager.getCustomRepository(
|
||||||
this.idempotencyKeyRepository_
|
this.idempotencyKeyRepository_
|
||||||
)
|
)
|
||||||
@@ -120,7 +119,7 @@ class IdempotencyKeyService extends BaseService {
|
|||||||
* @return {Promise} result of the update operation
|
* @return {Promise} result of the update operation
|
||||||
*/
|
*/
|
||||||
async update(idempotencyKey, update) {
|
async update(idempotencyKey, update) {
|
||||||
return this.atomicPhase_(async manager => {
|
return this.atomicPhase_(async (manager) => {
|
||||||
const idempotencyKeyRepo = manager.getCustomRepository(
|
const idempotencyKeyRepo = manager.getCustomRepository(
|
||||||
this.idempotencyKeyRepository_
|
this.idempotencyKeyRepository_
|
||||||
)
|
)
|
||||||
@@ -148,7 +147,7 @@ class IdempotencyKeyService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
async workStage(idempotencyKey, func) {
|
async workStage(idempotencyKey, func) {
|
||||||
try {
|
try {
|
||||||
return await this.atomicPhase_(async manager => {
|
return await this.atomicPhase_(async (manager) => {
|
||||||
let key
|
let key
|
||||||
|
|
||||||
const { recovery_point, response_code, response_body } = await func(
|
const { recovery_point, response_code, response_body } = await func(
|
||||||
|
|||||||
Reference in new issue
Block a user