Skip to content

Commit

Permalink
Adjust harvest code to delete removed events from the right table
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 committed Jun 9, 2024
1 parent 971874c commit 8a6d81d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/sync/harvest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async fn store_in_db(
let segments = segments.into_iter().map(Into::into).collect::<Vec<EventSegment>>();

// We upsert the event data.
upsert(db, "events", "opencast_id", &[
upsert(db, "all_events", "opencast_id", &[
("opencast_id", &opencast_id),
("state", &EventState::Ready),
("series", &series_id),
Expand Down Expand Up @@ -219,7 +219,7 @@ async fn store_in_db(

HarvestItem::EventDeleted { id: opencast_id, .. } => {
let rows_affected = db
.execute("delete from events where opencast_id = $1", &[&opencast_id])
.execute("delete from all_events where opencast_id = $1", &[&opencast_id])
.await?;
check_affected_rows_removed(rows_affected, "event", &opencast_id);
removed_events += 1;
Expand Down

0 comments on commit 8a6d81d

Please sign in to comment.