mirror of
https://github.com/dev-claw/vripper-project.git
synced 2026-08-19 08:35:41 +02:00
dependencies update (#109)
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
<version>3.0.6</version>
|
<version>3.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>me.mnlr.vripper</groupId>
|
<groupId>me.mnlr.vripper</groupId>
|
||||||
<artifactId>vripper-core</artifactId>
|
<artifactId>vripper-core</artifactId>
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<version>4.5.14</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>htmlcleaner</artifactId>
|
<artifactId>htmlcleaner</artifactId>
|
||||||
|
|||||||
@@ -1,58 +1,19 @@
|
|||||||
package me.mnlr.vripper
|
package me.mnlr.vripper
|
||||||
|
|
||||||
import jakarta.annotation.PreDestroy
|
import jakarta.annotation.PreDestroy
|
||||||
import org.springframework.beans.factory.annotation.Value
|
import me.mnlr.vripper.download.DownloadService
|
||||||
import org.springframework.jdbc.core.JdbcTemplate
|
import org.springframework.jdbc.core.JdbcTemplate
|
||||||
import org.springframework.stereotype.Component
|
import org.springframework.stereotype.Component
|
||||||
import me.mnlr.vripper.download.DownloadService
|
|
||||||
import me.mnlr.vripper.services.AsyncTaskRunnerService
|
|
||||||
import java.nio.file.Path
|
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
import java.util.*
|
|
||||||
import java.util.regex.Pattern
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
class Management(
|
class Management(
|
||||||
private val jdbcTemplate: JdbcTemplate,
|
private val jdbcTemplate: JdbcTemplate,
|
||||||
@Value("\${base.dir}") baseDir: String,
|
|
||||||
@Value("\${base.dir.name}") baseDirName: String,
|
|
||||||
private val asyncTaskRunnerService: AsyncTaskRunnerService,
|
|
||||||
private val downloadService: DownloadService
|
private val downloadService: DownloadService
|
||||||
) {
|
) {
|
||||||
private val backupFolder: Path
|
|
||||||
|
|
||||||
init {
|
|
||||||
backupFolder = Path.of(baseDir, baseDirName, "backup")
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
fun destroy() {
|
fun destroy() {
|
||||||
// taskRunnerService.destroy()
|
|
||||||
downloadService.destroy()
|
downloadService.destroy()
|
||||||
jdbcTemplate.execute("SHUTDOWN")
|
jdbcTemplate.execute("SHUTDOWN")
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PostConstruct
|
|
||||||
// @Scheduled(cron = "0 0 0 ? * *")
|
|
||||||
// private fun backup() {
|
|
||||||
//
|
|
||||||
// for (file in Files.list(backupFolder)) {
|
|
||||||
// val matcher = BACKUP_FILE_PATTERN.matcher(file.fileName.toString())
|
|
||||||
// if (matcher.find()) {
|
|
||||||
// val localDate = LocalDate.parse(matcher.group(1), FORMATTER)
|
|
||||||
// if (localDate.isEqual(LocalDate.now())) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // create a backup file
|
|
||||||
// val backupFile = backupFolder.resolve("db_${LocalDateTime.now().format(FORMATTER)}.tar.gz")
|
|
||||||
// jdbcTemplate.execute("BACKUP DATABASE TO '${backupFile}' BLOCKING")
|
|
||||||
// }
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
val FORMATTER: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
|
||||||
private val BACKUP_FILE_PATTERN = Pattern.compile("^db_(\\d{4}-\\d{2}-\\d{2})\\.tar\\.gz$")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
<version>3.0.6</version> <!-- lookup parent from repository -->
|
<version>3.1.3</version> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>me.mnlr.vripper</groupId>
|
<groupId>me.mnlr.vripper</groupId>
|
||||||
<artifactId>vripper-gui</artifactId>
|
<artifactId>vripper-gui</artifactId>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="AdditionalModuleElements">
|
||||||
|
<content url="file://$MODULE_DIR$" dumb="true">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vripper-web-ui/dist" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vripper-web-ui/tmp" />
|
||||||
|
</content>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="AdditionalModuleElements">
|
||||||
|
<content url="file://$MODULE_DIR$" dumb="true">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.0.4</version>
|
<version>3.1.3</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>me.mnlr.vripper</groupId>
|
<groupId>me.mnlr.vripper</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user