Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Loggie
Commits
bce42a37
Commit
bce42a37
authored
2 years ago
by
ethfoo
Browse files
Options
Download
Email Patches
Plain Diff
Fix(grpc source): move private fields from header to meta
parent
e24884f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+1
-1
Dockerfile
pkg/source/grpc/batch.go
+9
-7
pkg/source/grpc/batch.go
with
10 additions
and
8 deletions
+10
-8
Dockerfile
+
1
-
1
View file @
bce42a37
...
...
@@ -8,7 +8,7 @@ ARG TARGETOS
WORKDIR
/
COPY
. .
# Build
#RUN
CGO_ENABLED=1 go build -mod=vendor -a -o loggie cmd/loggie/main.go
#RUN
make build
RUN if
[
"
$TARGETARCH
"
=
"arm64"
]
;
then
apt-get update
&&
apt-get
install
-y
gcc-aarch64-linux-gnu
&&
export
CC
=
aarch64-linux-gnu-gcc
&&
export
CC_FOR_TARGET
=
gcc-aarch64-linux-gnu
;
fi
\
&&
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
CC
=
$CC
CC_FOR_TARGET
=
$CC_FOR_TARGET
make build
...
...
This diff is collapsed.
Click to expand it.
pkg/source/grpc/batch.go
+
9
-
7
View file @
bce42a37
...
...
@@ -65,16 +65,19 @@ func (b *batch) size() int {
func
(
b
*
batch
)
append
(
e
api
.
Event
)
{
currentIndex
:=
b
.
eventIndex
header
:=
e
.
Header
(
)
header
[
batchEventIndexKey
]
=
currentI
ndex
header
[
batchIndexKey
]
=
b
.
index
e
.
Meta
()
.
Set
(
batchEventIndexKey
,
currentIndex
)
e
.
Meta
()
.
Set
(
batchIndexKey
,
b
.
i
ndex
)
b
.
events
[
currentIndex
]
=
e
b
.
eventIndex
++
}
func
(
b
*
batch
)
ack
(
e
api
.
Event
)
{
header
:=
e
.
Header
()
index
:=
header
[
batchEventIndexKey
]
.
(
int32
)
indexRaw
,
exist
:=
e
.
Meta
()
.
Get
(
batchEventIndexKey
)
if
!
exist
{
return
}
index
:=
indexRaw
.
(
int32
)
delete
(
b
.
events
,
index
)
if
len
(
b
.
events
)
==
0
{
...
...
@@ -166,8 +169,7 @@ func (bc *batchChain) run() {
}
case
es
:=
<-
bc
.
ackEvents
:
for
_
,
e
:=
range
es
{
header
:=
e
.
Header
()
if
batchIndex
,
ok
:=
header
[
batchIndexKey
];
ok
{
if
batchIndex
,
ok
:=
e
.
Meta
()
.
Get
(
batchIndexKey
);
ok
{
if
b
,
exist
:=
bs
[
batchIndex
.
(
uint32
)];
exist
{
b
.
ack
(
e
)
if
b
.
isDone
()
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help