Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
25ba5b0f
Commit
25ba5b0f
authored
Jul 01, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6454fbcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
wcfs/wcfs.go
wcfs/wcfs.go
+20
-5
No files found.
wcfs/wcfs.go
View file @
25ba5b0f
...
...
@@ -2110,17 +2110,30 @@ func main() {
//log.CopyStandardLogTo("WARNING") // XXX -> "DEBUG" if -d ?
defer
log
.
Flush
()
err
:=
_main
()
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
}
func
_main
()
(
err
error
)
{
debug
:=
flag
.
Bool
(
"d"
,
false
,
"debug"
)
autoexit
:=
flag
.
Bool
(
"autoexit"
,
false
,
"automatically stop service when there is no client activity"
)
// XXX option to prevent starting if wcfs was already started ?
// XXX option to prevent starting if wcfs was already started/mounted on mntpt ?
// XXX do the check unconditionally?
flag
.
Parse
()
if
len
(
flag
.
Args
())
!=
2
{
log
.
Fatal
f
(
"Usage: %s [OPTIONS] zurl mntpt"
,
os
.
Args
[
0
])
fmt
.
Error
f
(
"Usage: %s [OPTIONS] zurl mntpt"
,
os
.
Args
[
0
])
}
zurl
:=
flag
.
Args
()[
0
]
mntpt
:=
flag
.
Args
()[
1
]
defer
xerr
.
Contextf
(
&
err
,
"fsserve %s <- %s"
,
mntpt
,
zurl
)
// XXX text
xclose
:=
func
(
c
io
.
Closer
)
{
err
=
xerr
.
First
(
err
,
c
.
Close
())
}
// debug -> precise t, no dates (XXX -> always precise t?)
if
*
debug
{
stdlog
.
SetFlags
(
stdlog
.
Lmicroseconds
)
...
...
@@ -2132,16 +2145,16 @@ func main() {
ReadOnly
:
true
,
})
if
err
!=
nil
{
log
.
Fatal
(
err
)
return
err
}
defer
zstor
.
Close
(
)
defer
xclose
(
zstor
)
zwatchq
:=
make
(
chan
zodb
.
Event
)
at0
:=
zstor
.
AddWatch
(
zwatchq
)
defer
zstor
.
DelWatch
(
zwatchq
)
zdb
:=
zodb
.
NewDB
(
zstor
)
defer
zdb
.
Close
()
// XXX err
defer
xclose
(
zdb
)
zhead
,
err
:=
zopen
(
ctx
,
zdb
,
&
zodb
.
ConnOptions
{
At
:
at0
,
...
...
@@ -2278,4 +2291,6 @@ func main() {
log
.
Fatal
(
err
)
// XXX err ctx?
}
<-
done
return
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