Skip to content

Commit

Permalink
[ML4SE-249] Changed domain and files folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikrise2 authored and nbirillo committed Dec 11, 2023
1 parent 3dbe491 commit 6d7a592
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ data class MainTaskTrackerConfig(
val agreementFilePath = "$pluginFolderPath/agreement/agreement.json"
val logFilesFolder = "$pluginFolderPath/logs"
const val PLUGIN_PROPERTIES_FILE = "$PLUGIN_NAME.properties"
private const val DOMAIN = "http://0.0.0.0:8080"
private const val DOMAIN = "https://tt-server-5.labs.jb.gg"

fun getRoute(path: String) = "$DOMAIN/$path"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.jetbrains.research.tasktracker.util
import io.ktor.http.content.*
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.server.util.*
import io.ktor.util.pipeline.*
import org.jetbrains.exposed.sql.transactions.transaction
import org.jetbrains.research.tasktracker.database.models.Research
Expand All @@ -12,6 +11,8 @@ import java.nio.file.Path
import java.nio.file.Paths
import kotlin.io.path.createDirectories

private const val FILE_DIRECTORY = "/tmp/files/"

suspend inline fun PipelineContext<Unit, ApplicationCall>.createLogFile(
logFileType: String,
researchId: Int
Expand All @@ -36,7 +37,7 @@ fun createDirectoryPath(researchId: Int, subDirectory: String): Path {
Research.findById(researchId)?.user?.id
?: error("There are no research with id `$researchId`")
}
val directoryPath = Paths.get("files/$researchId/$userId/$subDirectory")
val directoryPath = Paths.get("$FILE_DIRECTORY$researchId/$userId/$subDirectory")
directoryPath.createDirectories()
return directoryPath
}
Expand Down

0 comments on commit 6d7a592

Please sign in to comment.