Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
fixed duplicate rooms in finished_without_recordings query
Browse files Browse the repository at this point in the history
  • Loading branch information
khodzha committed Aug 21, 2020
1 parent 7b15655 commit 90ef8ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/db/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ pub(crate) fn finished_without_recordings(
super::rtc::ALL_COLUMNS,
super::janus_backend::ALL_COLUMNS,
))
.distinct_on(room::id)
.load(conn)
}

Expand Down Expand Up @@ -353,6 +354,9 @@ mod tests {
let _rtc3 = shared_helpers::insert_rtc_with_room(&conn, &room3);

shared_helpers::insert_janus_rtc_stream(&conn, &backend1, &rtc1);
// we insert two rtc_streams to simulate stream stop & start
// this should not affect number of returned rooms (there was a bug when it did)
shared_helpers::insert_janus_rtc_stream(&conn, &backend2, &rtc2);
shared_helpers::insert_janus_rtc_stream(&conn, &backend2, &rtc2);

let rooms = finished_without_recordings(&conn)
Expand Down

0 comments on commit 90ef8ff

Please sign in to comment.