Fix error on initialization with no symbols

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-02-19 17:51:44 +00:00
parent 4f73058792
commit 4665891316
3 changed files with 12 additions and 2 deletions

View File

@@ -142,6 +142,11 @@ async fn handle_message(
news_backfill_sender: mpsc::Sender<backfill::Message>,
message: Message,
) {
if message.assets.is_empty() {
message.response.send(()).unwrap();
return;
}
let (us_equity_symbols, crypto_symbols): (Vec<_>, Vec<_>) = message
.assets
.clone()
@@ -233,8 +238,8 @@ async fn handle_message(
let position_future = async {
alpaca::api::incoming::position::get_by_symbol(
&config.alpaca_rate_limiter,
&config.alpaca_client,
&config.alpaca_rate_limiter,
&symbol,
Some(backoff::infinite()),
)