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