hotfix(wallet): comment out history timer to fix app hanging on close

Fixes #8401

Threads in Nim are very bad and when the app closes, the thread doesn't close until it is done. That means that the 20 minute timer needs to finish before it can be closed.
This commit is contained in:
Jonathan Rainville 2022-11-28 15:52:21 -05:00
parent 316372b469
commit dd1caf7a48
1 changed files with 12 additions and 12 deletions

View File

@ -695,17 +695,17 @@ QtObject:
self.checkRecentHistory(true) self.checkRecentHistory(true)
proc startFetchingHistoryTimer(self: Service, resetTimeToNow = true) = proc startFetchingHistoryTimer(self: Service, resetTimeToNow = true) =
if(self.closingApp): if(self.closingApp or
not singletonInstance.localAccountSensitiveSettings.getIsWalletEnabled() or
self.isHistoryFetchTimerAlreadyRunning):
return return
if(self.isHistoryFetchTimerAlreadyRunning): # TODO move this to status-go, because the 20 minutes timer leaves the app hanging when trying to leave
return # self.isHistoryFetchTimerAlreadyRunning = true
# let arg = TimerTaskArg(
self.isHistoryFetchTimerAlreadyRunning = true # tptr: cast[ByteAddress](timerTask),
let arg = TimerTaskArg( # vptr: cast[ByteAddress](self.vptr),
tptr: cast[ByteAddress](timerTask), # slot: "onStartHistoryFetchingTimer",
vptr: cast[ByteAddress](self.vptr), # timeoutInMilliseconds: CheckHistoryIntervalInMilliseconds
slot: "onStartHistoryFetchingTimer", # )
timeoutInMilliseconds: CheckHistoryIntervalInMilliseconds # self.threadpool.start(arg)
)
self.threadpool.start(arg)