Optimize binary size
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
28
backend/Cargo.lock
generated
28
backend/Cargo.lock
generated
@@ -197,7 +197,6 @@ dependencies = [
|
||||
"sqlx",
|
||||
"time 0.3.28",
|
||||
"tokio",
|
||||
"tungstenite 0.20.0",
|
||||
"websocket-util",
|
||||
]
|
||||
|
||||
@@ -391,12 +390,6 @@ dependencies = [
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "data-encoding"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
|
||||
|
||||
[[package]]
|
||||
name = "deadpool"
|
||||
version = "0.9.5"
|
||||
@@ -2154,7 +2147,7 @@ dependencies = [
|
||||
"native-tls",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tungstenite 0.18.0",
|
||||
"tungstenite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2254,25 +2247,6 @@ dependencies = [
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tungstenite"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e862a1c4128df0112ab625f55cd5c934bcb4312ba80b39ae4b4835a3fd58e649"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"data-encoding",
|
||||
"http",
|
||||
"httparse",
|
||||
"log",
|
||||
"rand",
|
||||
"sha1",
|
||||
"thiserror",
|
||||
"url",
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typemap-ors"
|
||||
version = "1.0.0"
|
||||
|
@@ -4,10 +4,10 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
panic = 'abort'
|
||||
|
||||
[profile.dev]
|
||||
panic = 'abort'
|
||||
panic = 'abort'
|
||||
strip = true
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -38,5 +38,4 @@ time = { version = "0.3.27", features = [
|
||||
futures = "0.3.28"
|
||||
websocket-util = "0.11.2"
|
||||
futures-util = "0.3.28"
|
||||
tungstenite = "0.20.0"
|
||||
async-trait = "0.1.73"
|
||||
|
@@ -1,4 +1,5 @@
|
||||
FROM rust AS builder
|
||||
FROM rust:alpine AS builder
|
||||
RUN apk add --no-cache pkgconf musl-dev openssl-dev
|
||||
|
||||
WORKDIR /usr/src/qrust
|
||||
|
||||
@@ -12,7 +13,7 @@ RUN rm -rf src
|
||||
COPY . .
|
||||
RUN cargo build --release
|
||||
|
||||
FROM frolvlad/alpine-glibc AS backend
|
||||
FROM alpine AS backend
|
||||
|
||||
WORKDIR /usr/src/qrust
|
||||
|
||||
|
@@ -22,7 +22,7 @@ impl ToString for CryptoUrl {
|
||||
pub type Crypto = CustomUrl<CryptoUrl>;
|
||||
|
||||
pub async fn init_stream_subscription_mpsc(
|
||||
postgres_pool: PostgresPool,
|
||||
postgres_pool: &PostgresPool,
|
||||
) -> Result<(Arc<Mutex<StockStreamSubscription<IEX>>>, AssetMPSC), Box<dyn Error + Send + Sync>> {
|
||||
let client = create_alpaca_client_from_env().await?;
|
||||
|
||||
@@ -30,7 +30,7 @@ pub async fn init_stream_subscription_mpsc(
|
||||
.subscribe::<RealtimeData<Crypto, Bar, Quote, Trade>>()
|
||||
.await?;
|
||||
|
||||
let symbols = get_assets_crypto(&postgres_pool)
|
||||
let symbols = get_assets_crypto(postgres_pool)
|
||||
.await?
|
||||
.iter()
|
||||
.map(|asset| asset.symbol.clone())
|
||||
|
@@ -11,7 +11,7 @@ use std::{error::Error, sync::Arc};
|
||||
use tokio::sync::{mpsc, Mutex};
|
||||
|
||||
pub async fn init_stream_subscription_mpsc(
|
||||
postgres_pool: PostgresPool,
|
||||
postgres_pool: &PostgresPool,
|
||||
) -> Result<(Arc<Mutex<StockStreamSubscription<IEX>>>, AssetMPSC), Box<dyn Error + Send + Sync>> {
|
||||
let client = create_alpaca_client_from_env().await?;
|
||||
|
||||
@@ -19,7 +19,7 @@ pub async fn init_stream_subscription_mpsc(
|
||||
.subscribe::<RealtimeData<IEX, Bar, Quote, Trade>>()
|
||||
.await?;
|
||||
|
||||
let symbols = get_assets_stocks(&postgres_pool)
|
||||
let symbols = get_assets_stocks(postgres_pool)
|
||||
.await?
|
||||
.iter()
|
||||
.map(|asset| asset.symbol.clone())
|
||||
|
@@ -29,7 +29,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
|
||||
// Stock Live Data
|
||||
let (stock_live_stream_subscription_mutex, stock_live_mpsc) =
|
||||
stocks::init_stream_subscription_mpsc(postgres_pool.clone()).await?;
|
||||
stocks::init_stream_subscription_mpsc(&postgres_pool).await?;
|
||||
let stock_live_mpsc_sender_arc = Arc::new(stock_live_mpsc.sender);
|
||||
|
||||
threads.push(spawn(run_data_live::<IEX>(
|
||||
@@ -40,7 +40,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
|
||||
// Crypto Live Data
|
||||
let (crypto_stream_subscription_mutex, crypto_live_mpsc) =
|
||||
crypto::init_stream_subscription_mpsc(postgres_pool.clone()).await?;
|
||||
crypto::init_stream_subscription_mpsc(&postgres_pool).await?;
|
||||
let crypto_live_mpsc_sender_arc = Arc::new(crypto_live_mpsc.sender);
|
||||
|
||||
threads.push(spawn(run_data_live::<Crypto>(
|
||||
|
Reference in New Issue
Block a user