Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update projects json #252

Merged
merged 2 commits into from
Nov 19, 2024
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 @@ -6,6 +6,8 @@ import io.tofhir.server.repository.mappingContext.MappingContextFolderRepository
import io.tofhir.server.repository.schema.SchemaFolderRepository
import io.tofhir.server.repository.terminology.TerminologySystemFolderRepository
import io.tofhir.engine.Execution.actorSystem.dispatcher
import io.tofhir.engine.util.FileUtils
import io.tofhir.server.repository.project.ProjectFolderRepository
import io.tofhir.server.service.db.FolderDBInitializer

import scala.concurrent.Future
Expand All @@ -31,6 +33,8 @@ class ReloadService(mappingRepository: ProjectMappingFolderRepository,
mappingJobRepository.reloadJobDefinitions()
mappingContextRepository.reloadMappingContextDefinitions()
terminologySystemFolderRepository.reloadTerminologySystems()
// Delete projects.json before reload projects
folderDBInitializer.removeProjectsJsonFile()
folderDBInitializer.init()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,14 @@ class FolderDBInitializer(schemaFolderRepository: SchemaFolderRepository,
projects
}

/**
* Removes the projects.json file.
*/
def removeProjectsJsonFile(): Unit = {
val file = FileUtils.getPath(ProjectFolderRepository.PROJECTS_JSON).toFile
if (file.exists()) {
file.delete()
}
}

}
Loading