Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Add status endpoint #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ intellijPluginVersion=1.3.0
javassistVersion=3.28.0-GA
kotlinVersion=1.6.10
mockitoKotlinVersion=4.0.0
projectorClientVersion=aeaf9989
projectorClientVersion=1b08e117
projectorClientGroup=com.github.JetBrains.projector-client
targetJvm=11
jetbrainsMonoVersion=2.242
Expand Down
6 changes: 6 additions & 0 deletions projector-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Unreleased

## Fixed

- PRJ-691 PRJ-750 PRJ-779 Fix JetBrains account login
- Infinite transport initialization on relay failure

## Changed

- Switch to JS IR compilation for projector-client-web

## Added

- Status endpoint

# 1.6.0

## Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,13 @@ class ProjectorServer private constructor(
return allEvents
}

private var lastUserActionTimeStampMs: Long = 0L

private fun processMessage(clientSettings: ReadyClientSettings, message: ClientEvent) {
if (message is ClientUserEvent) {
lastUserActionTimeStampMs = System.currentTimeMillis()
}

if (
!clientSettings.setUpClientData.hasWriteAccess &&
message !is ClientRequestImageDataEvent &&
Expand Down Expand Up @@ -700,8 +706,9 @@ class ProjectorServer private constructor(
fun start() {
updateThread = createUpdateThread()
caretInfoUpdater.start()
lastUserActionTimeStampMs = System.currentTimeMillis()

WebsocketServer.createTransportBuilders().forEach {
WebsocketServer.createTransportBuilders(getLastUserActionTimeStampMs = ::lastUserActionTimeStampMs).forEach {
addTransport(it.attachDefaultServerEventHandlers(clientEventHandler).build())
}
}
Expand Down Expand Up @@ -733,6 +740,7 @@ class ProjectorServer private constructor(
fun stop(timeout: Int = 0) {
transports.forEach { it.stop(timeout) }
transports.clear()
lastUserActionTimeStampMs = 0L
caretInfoUpdater.stop()

if (::updateThread.isInitialized) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.jetbrains.projector.server.service.ProjectorImageCacher
import org.jetbrains.projector.util.logging.Logger

object WebsocketServer {
internal fun createTransportBuilders(): List<WsTransportBuilder> {
internal fun createTransportBuilders(getLastUserActionTimeStampMs: () -> Long): List<WsTransportBuilder> {
val builders = arrayListOf<WsTransportBuilder>()

val relayUrl = getOption(RELAY_PROPERTY_NAME)
Expand Down Expand Up @@ -68,6 +68,7 @@ object WebsocketServer {
)
}
}
serverBuilder.getLastUserActionTimeStampMs = getLastUserActionTimeStampMs

builders.add(serverBuilder)
}
Expand Down