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
1
Merge Requests
1
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
3d7bbff5
Commit
3d7bbff5
authored
6 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
edfe3e4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+6
-6
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+3
-2
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
3d7bbff5
...
...
@@ -472,25 +472,25 @@ func (fs *FileStorage) _watcher(w *fsnotify.Watcher) (err error) {
mainloop
:
for
{
if
!
first
{
tracef
(
"select ..."
)
//
tracef("select ...")
select
{
// XXX handle close
case
err
:=
<-
w
.
Errors
:
tracef
(
"error: %s"
,
err
)
//
tracef("error: %s", err)
if
err
!=
fsnotify
.
ErrEventOverflow
{
return
err
}
// events lost, but it is safe since we are always rechecking file size
case
e
:=
<-
w
.
Events
:
case
<-
w
.
Events
:
// we got some kind of "file was modified" event (e.g.
// write, truncate, chown ...) -> it is time to check the file again.
tracef
(
"event: %s"
,
e
)
//
tracef("event: %s", e)
case
<-
tick
.
C
:
// recheck the file periodically.
tracef
(
"tick"
)
//
tracef("tick")
}
}
first
=
false
...
...
@@ -512,7 +512,7 @@ mainloop:
// there is some data after toppos - try to advance as much as we can.
// start iterating afresh with empty buffer.
tracef
(
"scanning ..."
)
//
tracef("scanning ...")
it
:=
Iterate
(
seqReadAt
(
f
),
idx
.
TopPos
,
IterForward
)
for
{
err
=
it
.
NextTxn
(
LoadNoStrings
)
...
...
This diff is collapsed.
Click to expand it.
go/zodb/storage/fs1/filestorage_test.go
View file @
3d7bbff5
...
...
@@ -348,6 +348,7 @@ func BenchmarkIterate(b *testing.B) {
b
.
StopTimer
()
}
// XXX kill
var
tracef
=
func
(
format
string
,
argv
...
interface
{})
{
log
.
Printf
(
"W "
+
format
,
argv
...
)
}
...
...
@@ -405,7 +406,7 @@ func TestWatch(t *testing.T) {
}
xcommit
:=
func
(
at
zodb
.
Tid
,
objv
...
Object
)
zodb
.
Tid
{
tracef
(
"
\n\n
-> xcommit %s"
,
at
)
tracef
(
"-> xcommit %s"
,
at
)
defer
tracef
(
"<- xcommit"
)
t
.
Helper
()
tid
,
err
:=
zcommit
(
at
,
objv
...
)
...
...
@@ -444,7 +445,7 @@ func TestWatch(t *testing.T) {
// run py `zodb commit`.
//
// if one day it is either fixed, or worked around, we could ↑ 10 to 100.
for
i
:=
zodb
.
Oid
(
0
);
i
<
10
;
i
++
{
for
i
:=
zodb
.
Oid
(
1
);
i
<=
10
;
i
++
{
at
=
xcommit
(
at
,
Object
{
0
,
fmt
.
Sprintf
(
"data0.%d"
,
i
)},
Object
{
i
,
fmt
.
Sprintf
(
"data%d"
,
i
)})
...
...
This diff is collapsed.
Click to expand it.
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