Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ abstract class YamlDirectoryRepository<E, I>(
if (entity != null) {
watcherEvents.onDelete(entity)
}
deleteFile(resolvedPath.toFile())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ class ServerRepository(
) : LoadableRepository<Server, String> {

override suspend fun find(identifier: String): Server? {
return database.context.selectFrom(CLOUD_SERVERS)
return database.context.selectFrom(CLOUD_SERVERS)
.where(CLOUD_SERVERS.UNIQUE_ID.eq(identifier))
.limit(1)
.awaitFirstOrNull()
?.let { record -> mapCloudServersRecordToServer(record) }
}


suspend fun findServerByNumerical(group: String, id: Int): Server? {
return database.context.selectFrom(CLOUD_SERVERS)
.where(
Expand Down Expand Up @@ -121,7 +120,6 @@ class ServerRepository(
}
}

@Synchronized
override fun save(element: Server) {
numericalIdRepository.saveNumericalId(element.group, element.numericalId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ServerService(
return stopServer(server.toDefinition(), request.stopCause)
} catch (e: Exception) {
throw StatusException(
Status.INTERNAL.withDescription("Error occured whilest cleaning up stopped server: ").withCause(e)
Status.INTERNAL.withDescription("Error occurred whilst cleaning up stopped server: ").withCause(e)
)
}
}
Expand Down Expand Up @@ -216,7 +216,9 @@ class ServerService(
startedServers.add(server)
}
} catch (e: Exception) {
throw StatusException(Status.INTERNAL.withDescription("Error whilst starting multiple servers").withCause(e))
throw StatusException(
Status.INTERNAL.withDescription("Error whilst starting multiple servers").withCause(e)
)
}

return StartMultipleServerResponse.newBuilder()
Expand Down Expand Up @@ -245,7 +247,6 @@ class ServerService(
val server = buildServer(group, numericalId)
serverRepository.save(server)
val stub = host.stub ?: throw StatusException(Status.INTERNAL.withDescription("Server host has no stub"))
serverRepository.save(server)
try {
val result = stub.startServer(
ServerHostStartServerRequest.newBuilder()
Expand All @@ -263,7 +264,7 @@ class ServerService(
}
}

private suspend fun publishServerStartEvents(server: ServerDefinition, startCause: ServerStartCause) {
private fun publishServerStartEvents(server: ServerDefinition, startCause: ServerStartCause) {
pubSubClient.publish(
"event", ServerStartEvent.newBuilder()
.setServer(server)
Expand Down Expand Up @@ -380,7 +381,7 @@ class ServerService(

try {
timeout?.let {
group.timeout = GroupTimeout(it);
group.timeout = GroupTimeout(it)
}

groupServers.forEach { server ->
Expand Down