fix lobbyTrouper bus subscription
This commit is contained in:
parent
442d546f7e
commit
05202dd2b7
|
@ -181,6 +181,7 @@ private object LobbyTrouper {
|
|||
broomPeriod: FiniteDuration,
|
||||
resyncIdsPeriod: FiniteDuration
|
||||
)(trouper: => LobbyTrouper) = {
|
||||
system.lilaBus.subscribe(trouper, 'lobbyTrouper)
|
||||
system.scheduler.schedule(15 seconds, resyncIdsPeriod)(trouper ! actorApi.Resync)
|
||||
system.scheduler.scheduleOnce(7 seconds) {
|
||||
lila.common.ResilientScheduler(
|
||||
|
|
|
@ -7,7 +7,7 @@ private final class HookThieve(bus: lila.common.Bus) {
|
|||
import HookThieve._
|
||||
|
||||
def candidates(clock: chess.Clock.Config, monId: String): Fu[PoolHooks] =
|
||||
bus.ask[PoolHooks]('lobby)(GetCandidates(clock, _)) recover {
|
||||
bus.ask[PoolHooks]('lobbyTrouper)(GetCandidates(clock, _)) recover {
|
||||
case _ =>
|
||||
lila.mon.lobby.pool.thieve.timeout(monId)()
|
||||
PoolHooks(Vector.empty)
|
||||
|
@ -15,7 +15,7 @@ private final class HookThieve(bus: lila.common.Bus) {
|
|||
|
||||
def stolen(poolHooks: Vector[PoolHook], monId: String) = {
|
||||
lila.mon.lobby.pool.thieve.stolen(monId)(poolHooks.size)
|
||||
if (poolHooks.nonEmpty) bus.publish(StolenHookIds(poolHooks.map(_.hookId)), 'lobby)
|
||||
if (poolHooks.nonEmpty) bus.publish(StolenHookIds(poolHooks.map(_.hookId)), 'lobbyTrouper)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,13 +35,13 @@ private[setup] final class Processor(
|
|||
saveConfig(_ withHook config) >> {
|
||||
config.hook(uid, ctx.me, sid, blocking) match {
|
||||
case Left(hook) => fuccess {
|
||||
bus.publish(AddHook(hook), 'lobby)
|
||||
bus.publish(AddHook(hook), 'lobbyTrouper)
|
||||
Created(hook.id)
|
||||
}
|
||||
case Right(Some(seek)) => ctx.userId.??(gameCache.nbPlaying) map { nbPlaying =>
|
||||
if (nbPlaying >= maxPlaying) Refused
|
||||
else {
|
||||
bus.publish(AddSeek(seek), 'lobby)
|
||||
bus.publish(AddSeek(seek), 'lobbyTrouper)
|
||||
Created(seek.id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue