Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Sep 16, 2024
1 parent 277d0e1 commit 3067073
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion migrations/2024-09-16-095656_schedule-post/down.sql
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
alter table post drop column scheduled_time;
ALTER TABLE post
DROP COLUMN scheduled_time;

4 changes: 3 additions & 1 deletion migrations/2024-09-16-095656_schedule-post/up.sql
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
alter table post add column scheduled_time timestamptz;
ALTER TABLE post
ADD COLUMN scheduled_time timestamptz;

10 changes: 8 additions & 2 deletions src/scheduled_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,17 @@ async fn publish_scheduled_posts(context: &Data<LemmyContext>) {
diesel::update(post::table)
.filter(post::id.eq_any(post_ids))
.set(post::scheduled_time.eq(None::<DateTime<Utc>>))
.execute(&mut conn).await.unwrap();
.execute(&mut conn)
.await
.map_err(|e| error!("Failed update scheduled post: {e}"))
.ok();

for p in posts {
let send_activity = SendActivityData::CreatePost(p.0.clone());
ActivityChannel::submit_activity(send_activity, context).await.unwrap();
ActivityChannel::submit_activity(send_activity, context)
.await
.inspect_err(|e| error!("Failed federate scheduled post: {e}"))
.ok();
send_webmention(p.0, p.1);
}
}
Expand Down

0 comments on commit 3067073

Please sign in to comment.