Remove useless functions and add mount default

This commit is contained in:
Ben Sarmiento
2023-11-12 00:49:30 +01:00
parent fcbbff9ea2
commit 2657eff11c
2 changed files with 4 additions and 11 deletions

View File

@@ -71,11 +71,6 @@ func main() {
signal.Notify(shutdown, os.Interrupt, syscall.SIGTERM)
go func() {
defer func() {
if r := recover(); r != nil {
log.Errorf("Server panic: %v\n", r)
}
}()
log.Infof("Starting server on %s", addr)
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Panicf("Failed to start server: %v", err)
@@ -84,11 +79,6 @@ func main() {
// Start the mount in a goroutine with panic recovery.
go func() {
defer func() {
if r := recover(); r != nil {
log.Errorf("Mount panic: %v\n", r)
}
}()
log.Infof("Mounting on %s", mountPoint)
if err := zfs.Mount(mountPoint, config, torrentMgr, chunkMgr); err != nil {
log.Panicf("Failed to mount: %v", err)

View File

@@ -64,12 +64,15 @@ func (z *ZurgConfig) GetOnLibraryUpdate() string {
func (z *ZurgConfig) GetNetworkBufferSize() int {
if z.NetworkBufferSize == 0 {
return 32 * 1024
return 64 * 1024 // 64kb
}
return z.NetworkBufferSize
}
func (z *ZurgConfig) GetMountPoint() string {
if z.MountPoint == "" {
return "/mnt/zurg"
}
return z.MountPoint
}