|
|
@@ -73,12 +73,12 @@ public class StockRepository {
|
|
|
Quote quote = repository.findByCode(code).stream().findFirst().orElse(new Quote(code, null, null, now()));
|
|
|
quote.setPrice(getLastPrice(quote));
|
|
|
|
|
|
- if (quote.getName() == null) {
|
|
|
+ if (quote.getName() == null || quote.getPrice() == null) {
|
|
|
StockInfoResponse info = updateStockInformation(quote.getCode());
|
|
|
quote.setName(info.getName());
|
|
|
- }
|
|
|
|
|
|
- repository.save(quote);
|
|
|
+ repository.save(quote);
|
|
|
+ }
|
|
|
|
|
|
return quote;
|
|
|
}
|