Skip to content

Commit

Permalink
Merge pull request #425 from hoprnet/hotfix/2.0.1
Browse files Browse the repository at this point in the history
Update sleep duration and fix broker URL
  • Loading branch information
jeandemeusy authored Nov 22, 2023
2 parents a2950ad + e4ecc56 commit 69eafc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions ct-app/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async def apply_economic_model(self):
self.debug(f"Network size: {len(peers)}")

ready = len(topology) and len(subgraph) and len(peers)
await asyncio.sleep(1)
await asyncio.sleep(2)

eligibles = Utils.mergeTopologyPeersSubgraph(topology, peers, subgraph)
self.debug(f"Merged topology and subgraph data ({len(eligibles)} entries).")
Expand Down Expand Up @@ -280,10 +280,8 @@ async def distribute_rewards(self):
)

delay = Utils.nextDelayInSeconds(model.delay_between_distributions)
self.debug(f"Relay delay would be {delay} seconds.")
delay = 20

self.debug(f"Waiting {delay} seconds for next distribution.")

await asyncio.sleep(delay)

min_peers = self.params.distribution.min_eligible_peers
Expand All @@ -307,7 +305,7 @@ async def distribute_rewards(self):
# create celery tasks
app = Celery(
name=self.params.rabbitmq.project_name,
broker=f"amqp://{self.params.rabbitmq.username}:{self.params.rabbitmq.password}@{self.params.rabbitmq.host}/",
broker=f"amqp://{self.params.rabbitmq.username}:{self.params.rabbitmq.password}@{self.params.rabbitmq.host}/{self.params.rabbitmq.virtualhost}",
)
app.autodiscover_tasks(force=True)

Expand Down
6 changes: 3 additions & 3 deletions ct-app/core/model/economic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ def delay_between_distributions(self):

@classmethod
def fromDict(cls, _input: dict):
equations = Equations.from_dictionary(_input.get("equations", {}))
parameters = Parameters.from_dictionary(_input.get("parameters", {}))
budget = BudgetParameters.from_dictionary(_input.get("budget_param", {}))
equations = Equations.from_dictionary(_input.get("equations"))
parameters = Parameters.from_dictionary(_input.get("parameters"))
budget = BudgetParameters.from_dictionary(_input.get("budget_param"))

return cls(equations, parameters, budget)

Expand Down

0 comments on commit 69eafc0

Please sign in to comment.