mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 06:42:07 +01:00
Prevent running webui auto update in parallel to the setup (#1759)
This commit is contained in:
@@ -84,6 +84,8 @@ object WebInterfaceManager {
|
||||
private val preferences = Injekt.get<Application>().getSharedPreferences("server_util", Context.MODE_PRIVATE)
|
||||
private var currentUpdateTaskId: String = ""
|
||||
|
||||
private var isSetupComplete = false
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
private val network: NetworkHelper by injectLazy()
|
||||
|
||||
@@ -183,6 +185,7 @@ object WebInterfaceManager {
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
setupWebUI()
|
||||
isSetupComplete = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +256,7 @@ object WebInterfaceManager {
|
||||
val lastAutomatedUpdate = preferences.getLong(LAST_WEBUI_UPDATE_CHECK_KEY, System.currentTimeMillis())
|
||||
|
||||
val task = {
|
||||
if (isSetupComplete) {
|
||||
val log =
|
||||
KotlinLogging.logger(
|
||||
"${logger.name}::scheduleWebUIUpdateCheck(" +
|
||||
@@ -275,6 +279,7 @@ object WebInterfaceManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val wasPreviousUpdateCheckTriggered =
|
||||
(System.currentTimeMillis() - lastAutomatedUpdate) < updateInterval.inWholeMilliseconds
|
||||
|
||||
Reference in New Issue
Block a user