Take ttl and backend from parameters

This commit is contained in:
Dominik Werder
2022-12-12 17:24:38 +01:00
parent b3bd344f5d
commit b5c1039c78
14 changed files with 135 additions and 2606 deletions
+5
View File
@@ -31,6 +31,8 @@ pub enum SubCmd {
#[derive(Debug, Parser)]
pub struct Bsread {
#[arg(long)]
pub backend: String,
#[arg(long)]
pub scylla: Vec<String>,
#[arg(long)]
@@ -50,6 +52,7 @@ pub struct Bsread {
impl From<Bsread> for ZmtpClientOpts {
fn from(k: Bsread) -> Self {
Self {
backend: k.backend,
scylla: k.scylla,
sources: k.source,
rcvbuf: k.rcvbuf,
@@ -67,6 +70,8 @@ pub struct FetchEvents {
pub scylla: Vec<String>,
#[arg(long)]
pub channel: String,
#[arg(long)]
pub backend: String,
}
#[derive(Debug, Parser)]
+1 -1
View File
@@ -119,7 +119,7 @@ pub async fn fetch_events(opts: FetchEvents) -> Result<(), Error> {
"select series, scalar_type, shape_dims from series_by_channel where facility = ? and channel_name = ?",
)
.await?;
let qres = scy.execute(&qu_series, ("scylla", &opts.channel)).await?;
let qres = scy.execute(&qu_series, (&opts.backend, &opts.channel)).await?;
if let Some(rows) = qres.rows {
info!("Found {} matching series", rows.len());
for r in &rows {