Skip to content

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Sep 4, 2025

Description

This PR reduces the checkGeoStatus calls. Not it is called only on first sync and when create a new invoice instead of every sync

Preview

n/a

QA Notes

Used this log to compare

    var calledTimes = 0
    var initialTime = System.currentTimeMillis()
    suspend fun shouldBlockLightning(): Boolean {
        calledTimes++
        val seconds = (System.currentTimeMillis() - initialTime) / 1000
        Logger.debug("shouldBlockLightning called $calledTimes on the last $seconds seconds")
        return checkGeoStatus() == true && !hasExternalNode()
    }

Before

2025-09-04 10:09:10.386 23448-23541 APP                     to.bitkit.dev                        D  DEBUG: shouldBlockLightning called 20 on the last 120 seconds [CoreService.kt:156]

After

2025-09-04 10:18:53.136 24711-24797 APP                     to.bitkit.dev                        D  DEBUG: shouldBlockLightning called 6 on the last 204 seconds [CoreService.kt:153]

@jvsena42 jvsena42 requested a review from ovitrif September 4, 2025 13:25
@jvsena42 jvsena42 self-assigned this Sep 4, 2025
@jvsena42 jvsena42 enabled auto-merge September 4, 2025 13:34
@jvsena42 jvsena42 merged commit 2da923f into master Sep 4, 2025
5 checks passed
@jvsena42 jvsena42 deleted the fix/reduce-shouldBlockLightning-calls branch September 4, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants