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
dms3
go-dms3
Commits
13f00abc
Commit
13f00abc
authored
Oct 30, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockservice: signal add optimization
parent
04eba28a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
blockservice/blockservice.go
blockservice/blockservice.go
+4
-2
No files found.
blockservice/blockservice.go
View file @
13f00abc
...
...
@@ -37,7 +37,6 @@ func NewBlockService(d ds.Datastore, rem exchange.Interface) (*BlockService, err
// AddBlock adds a particular block to the service, Putting it into the datastore.
func
(
s
*
BlockService
)
AddBlock
(
b
*
blocks
.
Block
)
(
u
.
Key
,
error
)
{
k
:=
b
.
Key
()
log
.
Debug
(
"blockservice: storing [%s] in datastore"
,
k
)
// TODO(brian): define a block datastore with a Put method which accepts a
// block parameter
...
...
@@ -48,7 +47,10 @@ func (s *BlockService) AddBlock(b *blocks.Block) (u.Key, error) {
if
err
!=
nil
{
return
k
,
err
}
if
!
has
{
if
has
{
log
.
Debugf
(
"blockservice: storing [%s] in datastore (already stored)"
,
k
)
}
else
{
log
.
Debugf
(
"blockservice: storing [%s] in datastore"
,
k
)
err
:=
s
.
Datastore
.
Put
(
k
.
DsKey
(),
b
.
Data
)
if
err
!=
nil
{
return
k
,
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