Commit 2f69e47b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 198fab88
// Copyright (C) 2019 Nexedi SA and Contributors. // Copyright (C) 2019-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -152,21 +152,23 @@ func watchMain(argv []string) { ...@@ -152,21 +152,23 @@ func watchMain(argv []string) {
} }
zurl := argv[0] zurl := argv[0]
ctx := context.Background() err := watchMain_(context.Background(), zurl, verbose)
if err != nil {
prog.Fatal(err)
}
}
func watchMain_(ctx context.Context, zurl string, verbose bool) (err error) {
stor, err := zodb.Open(ctx, zurl, &zodb.OpenOptions{ReadOnly: true}) stor, err := zodb.Open(ctx, zurl, &zodb.OpenOptions{ReadOnly: true})
if err != nil { if err != nil {
prog.Fatal(err) return err
} }
defer func() { defer func() {
err := stor.Close() err2 := stor.Close()
if err != nil { if err == nil {
prog.Fatal(err) err = err2
} }
}() }()
err = Watch(ctx, stor, os.Stdout, verbose) return Watch(ctx, stor, os.Stdout, verbose)
if err != nil {
prog.Fatal(err)
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment