Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add handler to expiry service #855

Merged
merged 1 commit into from
Nov 2, 2021
Merged

Conversation

sandrask
Copy link
Contributor

@sandrask sandrask commented Nov 2, 2021

Add handler to expiry service such that it can inspect items to be deleted and take some action (e.g. log them in case they were not expected to be found)
Also, add expiry handler to witness store in order to log unsuccessful anchors (e.g. anchors that failed due to not having enough witnesess)

Closes #854

Signed-off-by: Sandra Vrtikapa sandra.vrtikapa@securekey.com

@cla-bot cla-bot bot added the cla-signed label Nov 2, 2021
@sandrask sandrask changed the title feat: Add handler to expiry service wip: Add handler to expiry service Nov 2, 2021
@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #855 (8cf8561) into main (4909584) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #855      +/-   ##
==========================================
+ Coverage   89.38%   89.41%   +0.02%     
==========================================
  Files         148      148              
  Lines       13125    13160      +35     
==========================================
+ Hits        11732    11767      +35     
  Misses        855      855              
  Partials      538      538              
Impacted Files Coverage Δ
pkg/store/expiry/expiry.go 90.76% <100.00%> (+0.93%) ⬆️
pkg/store/witness/witness.go 90.85% <100.00%> (+1.38%) ⬆️
pkg/observer/pubsub.go 94.49% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4909584...8cf8561. Read the comment docs.

Add handler to expiry service such that it can inspect items to be deleted and take some action (e.g. log them in case they were not expected to be found)
Also, add expiry handler to witness store in order to log unsuccessful anchors (e.g. anchors that failed due to not having enough witnesess)

Closes trustbloc#854

Signed-off-by: Sandra Vrtikapa <sandra.vrtikapa@securekey.com>
@sandrask sandrask changed the title wip: Add handler to expiry service feat: Add handler to expiry service Nov 2, 2021
@fqutishat fqutishat merged commit 675595e into trustbloc:main Nov 2, 2021
anchors = append(anchors, a)
}

logger.Errorf("failed to process anchors: %s", anchors)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's always an error being logged here? Is this right?

Copy link
Contributor Author

@sandrask sandrask Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DRK3 yes, we wanted to record when anchors don't get processed (e.g. they didn't get enough witnesses)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, any anchors here represent ones that didn't get processed, so you log here and then when this function returns the expiry service deletes them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add handler to expiry service
4 participants