remove followers streaming API which no-one uses

according to monitoring
pull/9850/head
Thibault Duplessis 2021-09-20 16:24:08 +02:00
parent 5b5a712f40
commit 1a92c93554
3 changed files with 11 additions and 18 deletions

View File

@ -142,17 +142,13 @@ final class Relation(
)
}
def apiFollowing(name: String) = apiRelation(name, Direction.Following)
def apiFollowers(name: String) = apiRelation(name, Direction.Followers)
private def apiRelation(name: String, direction: Direction) =
def apiFollowing(name: String) =
Action.async { implicit req =>
env.user.repo.named(name) flatMap {
env.user.repo.enabledNamed(name) flatMap {
_ ?? { user =>
apiC.jsonStream {
env.relation.stream
.follow(user, direction, MaxPerSecond(20))
.follow(user, Direction.Following, MaxPerSecond(20))
.map(env.api.userApi.one)
}.fuccess
}

View File

@ -643,7 +643,6 @@ GET /api/user/:name/tournament/created controllers.Api.tournamentsByOwner(name
GET /api/user/:name controllers.Api.user(name: String)
GET /api/user/:name/activity controllers.Api.activity(name: String)
GET /api/user/:name/following controllers.Relation.apiFollowing(name: String)
GET /api/user/:name/followers controllers.Relation.apiFollowers(name: String)
POST /api/user/:name/note controllers.User.apiWriteNote(name: String)
GET /api/user/:name/rating-history controllers.User.ratingHistory(name: String)
GET /api/user/:name/current-game controllers.User.tvExport(name: String)

View File

@ -31,16 +31,14 @@ final class RelationStream(
.mapAsync(1)(userRepo.usersFromSecondary)
.mapConcat(identity)
private def selectField(d: Direction) =
d match {
case Direction.Following => "u1"
case Direction.Followers => "u2"
}
private def projectField(d: Direction) =
d match {
case Direction.Following => "u2"
case Direction.Followers => "u1"
}
private def selectField(d: Direction) = d match {
case Direction.Following => "u1"
case Direction.Followers => "u2"
}
private def projectField(d: Direction) = d match {
case Direction.Following => "u2"
case Direction.Followers => "u1"
}
}
object RelationStream {