Fix issue with exporting
This commit is contained in:
10
src/main.rs
10
src/main.rs
@ -77,12 +77,6 @@ pub struct Data {
|
||||
_broadcast: Sender<()>,
|
||||
}
|
||||
|
||||
impl Debug for Data {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "Data {{ .. }}")
|
||||
}
|
||||
}
|
||||
|
||||
struct Ended;
|
||||
|
||||
impl Debug for Ended {
|
||||
@ -128,9 +122,9 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
|
||||
|
||||
match cmd_word {
|
||||
Some("clean") => {
|
||||
let sent_clean_age = env::var("SENT_CLEAN_AGE")?;
|
||||
let sent_clean_age = env::var("SENT_CLEAN_AGE").expect("No SENT_CLEAN_AGE provided");
|
||||
if sent_clean_age.is_empty() {
|
||||
panic!("No SENT_CLEAN_AGE")
|
||||
panic!("SENT_CLEAN_AGE empty")
|
||||
}
|
||||
sqlx::query!(
|
||||
"
|
||||
|
@ -79,8 +79,11 @@ pub async fn export_reminders(
|
||||
"
|
||||
);
|
||||
|
||||
let result =
|
||||
sqlx::query_as::<Database, ReminderCsv>(&sql).fetch_all(pool.inner()).await;
|
||||
let mut query = sqlx::query_as::<Database, ReminderCsv>(&sql);
|
||||
for channel in channels {
|
||||
query = query.bind(channel);
|
||||
}
|
||||
let result = query.fetch_all(pool.inner()).await;
|
||||
|
||||
match result {
|
||||
Ok(reminders) => {
|
||||
|
Reference in New Issue
Block a user