Skip to content

Commit bd33175

Browse files
committed
Remove discord hook from generate_element_issues handler
1 parent ef08020 commit bd33175

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/rpc/generate_element_issues.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
db::{self, conf::schema::Conf, user::schema::User},
3-
service::{self, discord},
2+
db::{self},
3+
service::{self},
44
Result,
55
};
66
use deadpool_sqlite::Pool;
@@ -17,7 +17,7 @@ pub struct Res {
1717
pub affected_elements: i64,
1818
}
1919

20-
pub async fn run(requesting_user: &User, pool: &Pool, conf: &Conf) -> Result<Res> {
20+
pub async fn run(pool: &Pool) -> Result<Res> {
2121
let elements =
2222
db::element::queries::select_updated_since(OffsetDateTime::UNIX_EPOCH, None, true, pool)
2323
.await?;
@@ -38,14 +38,6 @@ pub async fn run(requesting_user: &User, pool: &Pool, conf: &Conf) -> Result<Res
3838
db::element::queries::select_updated_since(OffsetDateTime::UNIX_EPOCH, None, false, pool)
3939
.await?;
4040
let res = service::element::generate_issues(elements.iter().collect(), pool).await?;
41-
discord::send(
42-
format!(
43-
"{} generated element issues. Affected elements: {}",
44-
requesting_user.name, res.affected_elements
45-
),
46-
discord::Channel::Api,
47-
conf,
48-
);
4941
Ok(Res {
5042
started_at: res.started_at,
5143
finished_at: res.finished_at,

src/rpc/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ pub async fn handle(
400400
),
401401
RpcMethod::GenerateElementIssues => RpcResponse::from(
402402
req.id.clone(),
403-
super::generate_element_issues::run(&user.unwrap(), &pool, &conf).await?,
403+
super::generate_element_issues::run(&pool).await?,
404404
),
405405
RpcMethod::SyncElements => RpcResponse::from(
406406
req.id.clone(),

0 commit comments

Comments
 (0)