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

.

parent 198fab88
// Copyright (C) 2019 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Copyright (C) 2019-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
......@@ -152,21 +152,23 @@ func watchMain(argv []string) {
}
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})
if err != nil {
prog.Fatal(err)
return err
}
defer func() {
err := stor.Close()
if err != nil {
prog.Fatal(err)
err2 := stor.Close()
if err == nil {
err = err2
}
}()
err = Watch(ctx, stor, os.Stdout, verbose)
if err != nil {
prog.Fatal(err)
}
return Watch(ctx, stor, os.Stdout, verbose)
}
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