@Scheduled(cron = "0 5 10 * * *")
This commit is contained in:
parent
b2ec763fde
commit
6fa4120ee1
|
|
@ -4,6 +4,7 @@ import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
|
@ -51,6 +52,7 @@ public class NbpTask {
|
||||||
|
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
|
@Scheduled(cron = "0 5 10 * * *")
|
||||||
void getNbpData( ) {
|
void getNbpData( ) {
|
||||||
Currency[] curencies =
|
Currency[] curencies =
|
||||||
{ Currency.Dollar, Currency.Euro, Currency.JapaneseYen, Currency.Pound, Currency.ChineJuan, Currency.SwissFranc };
|
{ Currency.Dollar, Currency.Euro, Currency.JapaneseYen, Currency.Pound, Currency.ChineJuan, Currency.SwissFranc };
|
||||||
|
|
@ -70,6 +72,7 @@ public class NbpTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
|
@Scheduled(cron = "0 5 10 * * *")
|
||||||
void getNbpGoldData( ) {
|
void getNbpGoldData( ) {
|
||||||
DataCena[] aDataCena = restTemplate.getForObject( nbp_url_gold, DataCena[].class );
|
DataCena[] aDataCena = restTemplate.getForObject( nbp_url_gold, DataCena[].class );
|
||||||
DataCena dataCena = aDataCena[0];
|
DataCena dataCena = aDataCena[0];
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import java.util.Map;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import services.Price;
|
import services.Price;
|
||||||
import services.tasks.Currency;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class PricesContainer {
|
public class PricesContainer {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue