Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
c3dbd4f1
Commit
c3dbd4f1
authored
Feb 18, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
745961cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
22 deletions
+13
-22
go/neo/storage.go
go/neo/storage.go
+13
-22
No files found.
go/neo/storage.go
View file @
c3dbd4f1
...
...
@@ -185,7 +185,7 @@ func (stor *Storage) m1initialize1(ctx context.Context, req neonet.Request) erro
lastTid
,
zerr1
:=
stor
.
back
.
LastTid
(
ctx
)
lastOid
,
zerr2
:=
stor
.
back
.
LastOid
(
ctx
)
if
zerr
:=
xerr
.
First
(
zerr1
,
zerr2
);
zerr
!=
nil
{
return
zerr
//
XXX send the error to M
return
zerr
//
TODO send the error to M ?
}
err
=
req
.
Reply
(
&
proto
.
AnswerLastIDs
{
LastTid
:
lastTid
,
LastOid
:
lastOid
})
...
...
@@ -287,7 +287,8 @@ func (stor *Storage) serve(ctx context.Context) (err error) {
wg
.
Add
(
1
)
go
func
()
{
defer
wg
.
Done
()
err
:=
stor
.
serveLink
(
ctx
,
req
,
idReq
)
// XXX ignore err? -> logged
err
:=
stor
.
serveLink
(
ctx
,
req
,
idReq
)
if
err
!=
nil
{
// XXX log err XXX vvv ok?
switch
errors
.
Cause
(
err
)
{
// XXX closed by main or peer down - all logged by main called
...
...
@@ -298,7 +299,7 @@ func (stor *Storage) serve(ctx context.Context) (err error) {
default
:
log
.
Error
(
ctx
,
err
)
}
return
}
}()
}
}
...
...
@@ -359,16 +360,6 @@ func (stor *Storage) serveLink(ctx context.Context, req *neonet.Request, idReq *
for
{
req
,
err
:=
link
.
Recv1
()
if
err
!=
nil
{
switch
errors
.
Cause
(
err
)
{
// XXX closed by main or peer down
// XXX review
case
neonet
.
ErrLinkDown
,
neonet
.
ErrLinkClosed
:
log
.
Info
(
ctx
,
err
)
// ok
default
:
log
.
Error
(
ctx
,
err
)
}
return
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