android, desktop: removed timer for some long running jobs (#3761)
This commit is contained in:
parent
6b8fc6fdcf
commit
f2d498dd79
@ -104,7 +104,7 @@ class SimplexService: Service() {
|
||||
if (wakeLock != null || isStartingService) return
|
||||
val self = this
|
||||
isStartingService = true
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
val chatController = ChatController
|
||||
waitDbMigrationEnds(chatController)
|
||||
try {
|
||||
|
@ -43,7 +43,7 @@ val appPreferences: AppPreferences
|
||||
val chatController: ChatController = ChatController
|
||||
|
||||
fun initChatControllerAndRunMigrations() {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
if (appPreferences.chatStopped.get() && appPreferences.storeDBPassphrase.get() && ksDatabasePassword.get() != null) {
|
||||
initChatController(startChat = ::showStartChatAfterRestartAlert)
|
||||
} else {
|
||||
|
@ -55,7 +55,7 @@ abstract class NtfManager {
|
||||
}
|
||||
|
||||
fun openChatAction(userId: Long?, chatId: ChatId) {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
awaitChatStartedIfNeeded(chatModel)
|
||||
if (userId != null && userId != chatModel.currentUser.value?.userId && chatModel.currentUser.value != null) {
|
||||
// TODO include remote host ID in desktop notifications?
|
||||
@ -70,7 +70,7 @@ abstract class NtfManager {
|
||||
}
|
||||
|
||||
fun showChatsAction(userId: Long?) {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
awaitChatStartedIfNeeded(chatModel)
|
||||
if (userId != null && userId != chatModel.currentUser.value?.userId && chatModel.currentUser.value != null) {
|
||||
// TODO include remote host ID in desktop notifications?
|
||||
|
@ -54,7 +54,7 @@ fun AddGroupMembersView(rhId: Long?, groupInfo: GroupInfo, creatingGroup: Boolea
|
||||
},
|
||||
inviteMembers = {
|
||||
allowModifyMembers = false
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 120_000) {
|
||||
for (contactId in selectedContacts) {
|
||||
val member = chatModel.controller.apiAddMember(rhId, groupInfo.groupId, contactId, selectedRole.value)
|
||||
if (member != null) {
|
||||
|
@ -62,7 +62,7 @@ fun DatabaseEncryptionView(m: ChatModel) {
|
||||
initialRandomDBPassphrase,
|
||||
progressIndicator,
|
||||
onConfirmEncrypt = {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
encryptDatabase(currentKey, newKey, confirmNewKey, initialRandomDBPassphrase, useKeychain, storedKey, progressIndicator)
|
||||
}
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ fun chatArchiveTitle(chatArchiveTime: Instant, chatLastStart: Instant): String {
|
||||
}
|
||||
|
||||
fun startChat(m: ChatModel, chatLastStart: MutableState<Instant?>, chatDbChanged: MutableState<Boolean>, progressIndicator: MutableState<Boolean>? = null) {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
try {
|
||||
progressIndicator?.value = true
|
||||
if (chatDbChanged.value) {
|
||||
@ -581,7 +581,7 @@ private fun importArchive(
|
||||
progressIndicator.value = true
|
||||
val archivePath = saveArchiveFromURI(importedArchiveURI)
|
||||
if (archivePath != null) {
|
||||
withLongRunningApi(slow = 60_000, deadlock = 180_000) {
|
||||
withLongRunningApi {
|
||||
try {
|
||||
m.controller.apiDeleteStorage()
|
||||
try {
|
||||
|
@ -49,7 +49,7 @@ fun LocalAuthView(m: ChatModel, authRequest: LocalAuthRequest) {
|
||||
}
|
||||
|
||||
private fun deleteStorageAndRestart(m: ChatModel, password: String, completed: (LAResult) -> Unit) {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
try {
|
||||
/** Waiting until [initChatController] finishes */
|
||||
while (m.ctrlInitInProgress.value) {
|
||||
|
@ -50,7 +50,7 @@ fun SetupDatabasePassphrase(m: ChatModel) {
|
||||
confirmNewKey,
|
||||
progressIndicator,
|
||||
onConfirmEncrypt = {
|
||||
withLongRunningApi(slow = 30_000, deadlock = 60_000) {
|
||||
withLongRunningApi {
|
||||
if (m.chatRunning.value == true) {
|
||||
// Stop chat if it's started before doing anything
|
||||
stopChatAsync(m)
|
||||
|
Loading…
Reference in New Issue
Block a user