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-routing
Commits
25a82692
Commit
25a82692
authored
Sep 01, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize offline SearchValue slightly
parent
991f2c38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
offline/offline.go
offline/offline.go
+4
-5
No files found.
offline/offline.go
View file @
25a82692
...
...
@@ -91,13 +91,12 @@ func (c *offlineRouting) GetValue(ctx context.Context, key string, _ ...ropts.Op
}
func
(
c
*
offlineRouting
)
SearchValue
(
ctx
context
.
Context
,
key
string
,
_
...
ropts
.
Option
)
(
<-
chan
[]
byte
,
error
)
{
out
:=
make
(
chan
[]
byte
)
out
:=
make
(
chan
[]
byte
,
1
)
go
func
()
{
defer
close
(
out
)
v
,
_
:=
c
.
GetValue
(
ctx
,
key
)
select
{
case
out
<-
v
:
case
<-
ctx
.
Done
()
:
v
,
err
:=
c
.
GetValue
(
ctx
,
key
)
if
err
==
nil
{
out
<-
v
}
}()
return
out
,
nil
...
...
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