BJ-917: Make PreparationFlowService async

This commit is contained in:
a.romanov 2020-05-27 15:37:30 +03:00 committed by a.romanov
parent 3df63949b5
commit beb3152943
3 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,11 @@ package com.rbkmoney.threeds.server.storage;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;
@EnableRetry
@EnableAsync
@ServletComponentScan
@SpringBootApplication
public class ThreeDsServerStorageApplication extends SpringApplication {

View File

@ -6,7 +6,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClientResponseException;
@ -14,7 +13,6 @@ import org.springframework.web.client.RestTemplate;
@Slf4j
@Service
@EnableRetry
@RequiredArgsConstructor
public class ThreeDsServerClient {

View File

@ -4,17 +4,17 @@ import com.rbkmoney.threeds.server.domain.root.rbkmoney.RBKMoneyPreparationReque
import com.rbkmoney.threeds.server.domain.root.rbkmoney.RBKMoneyPreparationResponse;
import com.rbkmoney.threeds.server.storage.client.ThreeDsServerClient;
import lombok.RequiredArgsConstructor;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@Service
@EnableRetry
@RequiredArgsConstructor
public class PreparationFlowService {
private final ThreeDsServerClient client;
private final PreparationFlowDataUpdater dataUpdater;
@Async
public void init(String providerId) {
String serialNum = dataUpdater.getCurrentSerialNum(providerId);