Remove useless functions and add mount default
This commit is contained in:
@@ -71,11 +71,6 @@ func main() {
|
|||||||
signal.Notify(shutdown, os.Interrupt, syscall.SIGTERM)
|
signal.Notify(shutdown, os.Interrupt, syscall.SIGTERM)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
log.Errorf("Server panic: %v\n", r)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
log.Infof("Starting server on %s", addr)
|
log.Infof("Starting server on %s", addr)
|
||||||
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
log.Panicf("Failed to start server: %v", err)
|
log.Panicf("Failed to start server: %v", err)
|
||||||
@@ -84,11 +79,6 @@ func main() {
|
|||||||
|
|
||||||
// Start the mount in a goroutine with panic recovery.
|
// Start the mount in a goroutine with panic recovery.
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
log.Errorf("Mount panic: %v\n", r)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
log.Infof("Mounting on %s", mountPoint)
|
log.Infof("Mounting on %s", mountPoint)
|
||||||
if err := zfs.Mount(mountPoint, config, torrentMgr, chunkMgr); err != nil {
|
if err := zfs.Mount(mountPoint, config, torrentMgr, chunkMgr); err != nil {
|
||||||
log.Panicf("Failed to mount: %v", err)
|
log.Panicf("Failed to mount: %v", err)
|
||||||
|
|||||||
@@ -64,12 +64,15 @@ func (z *ZurgConfig) GetOnLibraryUpdate() string {
|
|||||||
|
|
||||||
func (z *ZurgConfig) GetNetworkBufferSize() int {
|
func (z *ZurgConfig) GetNetworkBufferSize() int {
|
||||||
if z.NetworkBufferSize == 0 {
|
if z.NetworkBufferSize == 0 {
|
||||||
return 32 * 1024
|
return 64 * 1024 // 64kb
|
||||||
}
|
}
|
||||||
return z.NetworkBufferSize
|
return z.NetworkBufferSize
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z *ZurgConfig) GetMountPoint() string {
|
func (z *ZurgConfig) GetMountPoint() string {
|
||||||
|
if z.MountPoint == "" {
|
||||||
|
return "/mnt/zurg"
|
||||||
|
}
|
||||||
return z.MountPoint
|
return z.MountPoint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user