Skip to content

Commit

Permalink
fix: Aqua API and internal sqlite table cleaning (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
justprosh authored Sep 23, 2022
1 parent 1b4baa0 commit fe03062
Show file tree
Hide file tree
Showing 8 changed files with 627 additions and 361 deletions.
14 changes: 7 additions & 7 deletions aqua/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions aqua/resources-api.aqua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func unregisterService(resource_id: ResourceId, peer_id: PeerId) -> bool, *Error
success: *bool
error: *Error

on peer_id:
on HOST_PEER_ID:
t <- Peer.timestamp_sec()
sig_result = getTombstoneSignature(resource_id, peer_id, t, nil)
if sig_result.success == false:
Expand All @@ -156,14 +156,17 @@ func unregisterService(resource_id: ResourceId, peer_id: PeerId) -> bool, *Error
appendErrors(error, error_get)
success <<- false
else:
republish_result <- republishKey(key!)
if republish_result.success == false:
error <<- republish_result.error
else:
res <- addTombstone(resource_id, peer_id, t, nil, sig_result.signature!)
if res.success == false:
error <<- res.error
success <<- false

if peer_id != INIT_PEER_ID:
on peer_id:
republish_result <- republishKey(key!)
if republish_result.success == false:
error <<- republish_result.error
else:
res <- addTombstone(resource_id, peer_id, t, nil, sig_result.signature!)
if res.success == false:
error <<- res.error
success <<- false

nodes <- getNeighbours(resource_id)
successful: *bool
Expand Down
Loading

0 comments on commit fe03062

Please sign in to comment.