Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
9f0782bd
Commit
9f0782bd
authored
Feb 18, 2020
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(providers): upgrade warnings to errors
These errors all mean something is going very wrong.
parent
2bceee5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
providers/providers.go
providers/providers.go
+5
-5
No files found.
providers/providers.go
View file @
9f0782bd
...
...
@@ -133,13 +133,13 @@ func loadProvSet(dstore ds.Datastore, k []byte) (*providerSet, error) {
switch
{
case
err
!=
nil
:
// couldn't parse the time
log
.
Warning
(
"parsing providers record from disk: "
,
err
)
log
.
Error
(
"parsing providers record from disk: "
,
err
)
fallthrough
case
now
.
Sub
(
t
)
>
ProvideValidity
:
// or just expired
err
=
dstore
.
Delete
(
ds
.
RawKey
(
e
.
Key
))
if
err
!=
nil
&&
err
!=
ds
.
ErrNotFound
{
log
.
Warning
(
"failed to remove provider record from disk: "
,
err
)
log
.
Error
(
"failed to remove provider record from disk: "
,
err
)
}
continue
}
...
...
@@ -151,7 +151,7 @@ func loadProvSet(dstore ds.Datastore, k []byte) (*providerSet, error) {
log
.
Error
(
"base32 decoding error: "
,
err
)
err
=
dstore
.
Delete
(
ds
.
RawKey
(
e
.
Key
))
if
err
!=
nil
&&
err
!=
ds
.
ErrNotFound
{
log
.
Warning
(
"failed to remove provider record from disk: "
,
err
)
log
.
Error
(
"failed to remove provider record from disk: "
,
err
)
}
continue
}
...
...
@@ -264,13 +264,13 @@ func (pm *ProviderManager) run(proc goprocess.Process) {
switch
{
case
err
!=
nil
:
// couldn't parse the time
log
.
Warning
(
"parsing providers record from disk: "
,
err
)
log
.
Error
(
"parsing providers record from disk: "
,
err
)
fallthrough
case
gcTime
.
Sub
(
t
)
>
ProvideValidity
:
// or expired
err
=
pm
.
dstore
.
Delete
(
ds
.
RawKey
(
res
.
Key
))
if
err
!=
nil
&&
err
!=
ds
.
ErrNotFound
{
log
.
Warning
(
"failed to remove provider record from disk: "
,
err
)
log
.
Error
(
"failed to remove provider record from disk: "
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment