Load dbs on startup

This commit is contained in:
Ben Johnson
2020-11-03 14:50:16 -07:00
parent bcc6963db6
commit b1ec5c721b
6 changed files with 77 additions and 154 deletions

View File

@@ -87,8 +87,14 @@ func (m *Main) Run(args []string) (err error) {
m.logger.Printf("mounted %s; target=%s", m.Path, m.TargetPath)
fileSystem := litestream.NewFileSystem(m.TargetPath)
if err := fileSystem.Open(); err != nil {
return err
}
defer fileSystem.Close()
s := fs.New(conn, &config)
return s.Serve(&litestream.FileSystem{TargetPath: m.TargetPath})
return s.Serve(fileSystem)
}
func (m *Main) ensureTargetPath() error {