Skip to content

Commit

Permalink
Increase Escrower tock to avoid overly busy CPU during escrow process…
Browse files Browse the repository at this point in the history
…ing (#256)

* Increase Escrower tock to avoid overly busy CPU during escrow processing

Setting tock to 1.0 second runs escrower loop 30s delay and delegator approval received after 30 seconds

* Remove redundant looping inside escrower recur method

---------

Co-authored-by: Rubel Hassan Mollik <[email protected]>
  • Loading branch information
rubelhassan and Rubel Hassan Mollik authored Jul 11, 2024
1 parent 6bdb608 commit e69566e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,9 @@ def __init__(self, kvy, rgy, rvy, tvy, exc, vry, registrar, credentialer):
self.vry = vry
self.registrar = registrar
self.credentialer = credentialer
self.tock = 1.0

super(Escrower, self).__init__()
super(Escrower, self).__init__(tock=self.tock)

def recur(self, tyme):
""" Process all escrows once per loop. """
Expand All @@ -760,7 +761,6 @@ def recur(self, tyme):
self.vry.processEscrows()
self.registrar.processEscrows()
self.credentialer.processEscrows()

return False


Expand Down
2 changes: 1 addition & 1 deletion tests/app/test_delegating.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_delegator_end(helpers):
assert res.status_code == 200
op = res.json
count += 1
if count > 10:
if count > 60:
raise Exception("Delegator never processed the delegatee dip event")

# Delegator escrows completed and now aknowledges the delegatee dip event
Expand Down

0 comments on commit e69566e

Please sign in to comment.