Ingest EvtSet with zmtp init
This commit is contained in:
@@ -927,7 +927,7 @@ impl CaConn {
|
||||
// TODO handle not-found error:
|
||||
let ch_s = self.channels.get_mut(&cid).unwrap();
|
||||
let cssid = match ch_s {
|
||||
ChannelState::Created(_series, st2) => st2.cssid.clone(),
|
||||
ChannelState::FetchingSeriesId(st2) => st2.cssid.clone(),
|
||||
_ => {
|
||||
let name = self.name_by_cid.get(&cid);
|
||||
let e = Error::with_msg_no_trace(format!("channel_to_evented bad state {name:?} {ch_s:?}"));
|
||||
@@ -1381,7 +1381,7 @@ impl CaConn {
|
||||
let cssid = match ch_s {
|
||||
ChannelState::Creating { cssid, .. } => cssid.clone(),
|
||||
_ => {
|
||||
let e = Error::with_msg_no_trace("channel_to_evented bad state");
|
||||
let e = Error::with_msg_no_trace("handle_peer_ready bad state");
|
||||
return Ready(Some(Err(e)));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -119,7 +119,10 @@ impl DbUpdateWorker {
|
||||
.unwrap();
|
||||
} else {
|
||||
warn!("Duplicate for {}", item.channel);
|
||||
let sql="with q1 as (select ctid from ioc_by_channel_log where facility = $1 and channel = $2 and addr is not distinct from $3 order by tsmod desc, ctid desc limit 1) update ioc_by_channel_log t set archived = 1 from q1 where t.facility = $1 and t.channel = $2 and t.addr is not distinct from $3 and t.ctid != q1.ctid";
|
||||
let sql = concat!(
|
||||
"with q1 as (select ctid from ioc_by_channel_log where facility = $1 and channel = $2 and addr is not distinct from $3 order by tsmod desc, ctid desc limit 1)",
|
||||
" update ioc_by_channel_log t set archived = 1 from q1 where t.facility = $1 and t.channel = $2 and t.ctid != q1.ctid and archived != 1",
|
||||
);
|
||||
pg_client.execute(sql, &[&backend, &item.channel, &addr]).await.unwrap();
|
||||
pg_client
|
||||
.execute(&qu_update_tsmod, &[&backend, &item.channel, &addr, &responseaddr])
|
||||
|
||||
Reference in New Issue
Block a user