Support yaml config and run for swissfel-daqbuf-ca
This commit is contained in:
@@ -81,8 +81,8 @@ pub async fn chconf_from_database(channel: &Channel, ncc: &NodeConfigCached) ->
|
||||
if let Some(series) = channel.series() {
|
||||
let res = pgclient
|
||||
.query(
|
||||
"select channel, scalar_type, shape_dims from series_by_channel where series = $1",
|
||||
&[&(series as i64)],
|
||||
"select channel, scalar_type, shape_dims from series_by_channel where facility = $1 and series = $2",
|
||||
&[&channel.backend(), &(series as i64)],
|
||||
)
|
||||
.await
|
||||
.err_conv()?;
|
||||
|
||||
@@ -52,7 +52,7 @@ pub async fn delay_io_medium() {
|
||||
pub async fn create_connection(db_config: &Database) -> Result<Client, Error> {
|
||||
// TODO use a common already running worker pool for these queries:
|
||||
let d = db_config;
|
||||
let uri = format!("postgresql://{}:{}@{}:{}/{}", d.user, d.pass, d.host, 5432, d.name);
|
||||
let uri = format!("postgresql://{}:{}@{}:{}/{}", d.user, d.pass, d.host, d.port, d.name);
|
||||
let (cl, conn) = tokio_postgres::connect(&uri, NoTls)
|
||||
.await
|
||||
.map_err(|e| format!("Can not connect to database: {e:?}"))
|
||||
|
||||
Reference in New Issue
Block a user