Skip to content

Commit

Permalink
🔥 feat: 联调优化
Browse files Browse the repository at this point in the history
  • Loading branch information
cokie committed Mar 1, 2024
1 parent 8ad99f5 commit eedb357
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,17 @@ class RobotManagerServiceImpl(

private fun bindRobotStateChangeEvent(robot: QQRobot, context: Context) {
robot.addRobotStateChangeListener { state ->
val state = when (state) {
val s = when (state) {
Robot.State.Create -> RobotDO.State.Create
Robot.State.LoggingIn -> RobotDO.State.LoggingIn
Robot.State.LoggingFail -> RobotDO.State.LoggingFail
Robot.State.Online -> RobotDO.State.Online
Robot.State.Closed -> RobotDO.State.Closed
}
sessionFactory.withSession { modifyRobotState(robot.id(), state) }
sessionFactory.withSession { modifyRobotState(robot.id(), s) }
.runSubscriptionOn { context.runOnContext(it) }
.awaitSuspending()
modifyRobotState(robot.id(), state).awaitSuspending()
robotEvent.publishRobotStateChange(robot.id(), state).awaitSuspending()
robotEvent.publishRobotStateChange(robot.id(), s).awaitSuspending()
}
}

Expand Down

0 comments on commit eedb357

Please sign in to comment.