@@ -32,8 +32,8 @@ import kotlin.math.max
3232import kotlin.math.min
3333import kotlin.math.roundToLong
3434
35- const val RETRY_INTERVAL = 5 * 60 * 1000L // 5 minutes in ms
36- const val GIVE_UP = 30 * 60 * 1000L // 30 minutes in ms
35+ const val RETRY_INTERVAL_MS = 1 * 60 * 1000L // 1 minutes in ms
36+ const val GIVE_UP_MS = 30 * 60 * 1000L // 30 minutes in ms
3737
3838@HiltViewModel
3939class TransferViewModel @Inject constructor(
@@ -300,12 +300,12 @@ class TransferViewModel @Inject constructor(
300300 private var coopCloseRetryJob: Job ? = null
301301
302302 /* * Retry to coop close the channel(s) for 30 min */
303- fun startCoopCloseRetries (channels : List <ChannelDetails >, startTime : Long ) {
303+ fun startCoopCloseRetries (channels : List <ChannelDetails >, startTimeMs : Long ) {
304304 channelsToClose = channels
305305 coopCloseRetryJob?.cancel()
306306
307307 coopCloseRetryJob = viewModelScope.launch {
308- val giveUpTime = startTime + GIVE_UP
308+ val giveUpTime = startTimeMs + GIVE_UP_MS
309309
310310 while (isActive && System .currentTimeMillis() < giveUpTime) {
311311 Logger .info(" Trying coop close..." )
@@ -320,7 +320,7 @@ class TransferViewModel @Inject constructor(
320320 Logger .info(" Coop close failed: ${channelsFailedToCoopClose.map { it.channelId }} " )
321321 }
322322
323- delay(RETRY_INTERVAL )
323+ delay(RETRY_INTERVAL_MS )
324324 }
325325
326326 Logger .info(" Giving up on coop close." )
0 commit comments