Skip to content

Commit

Permalink
delete relay along study
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Oct 10, 2017
1 parent 4a686bb commit ad6e31b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/relay/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ final class Env(
import lila.study.actorApi._
def receive = {
case lila.study.actorApi.StudyLikes(id, likes) => api.setLikes(Relay.Id(id.value), likes)
case lila.hub.actorApi.study.RemoveStudy(studyId, _) => api.onStudyRemove(studyId)
}
})), 'studyLikes)
})), 'studyLikes, 'study)
}

object Env {
Expand Down
3 changes: 3 additions & 0 deletions modules/relay/src/main/RelayApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ final class RelayApi(
sendToContributors(id, "relayLog", JsonView.syncLogEventWrites writes event) >>-
event.error.foreach { err => logger.info(s"$id $err") }

private[relay] def onStudyRemove(studyId: Study.Id) =
coll.remove($id(studyId)).void

private[relay] def publishRelay(relay: Relay): Funit =
sendToContributors(relay.id, "relayData", JsonView.relayWrites writes relay)

Expand Down

0 comments on commit ad6e31b

Please sign in to comment.