mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
feat(static): release static files into memory while startup (#1471)
* 初始化时解压zip文件读取内存中 * update go.mod * 更新各种go版本
This commit is contained in:
9
main.go
9
main.go
@@ -4,13 +4,11 @@ import (
|
||||
"context"
|
||||
_ "embed"
|
||||
"flag"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -19,8 +17,6 @@ import (
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/util"
|
||||
"github.com/cloudreve/Cloudreve/v3/routers"
|
||||
|
||||
"github.com/mholt/archiver/v4"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -40,10 +36,7 @@ func init() {
|
||||
flag.StringVar(&scriptName, "database-script", "", "Name of database util script.")
|
||||
flag.Parse()
|
||||
|
||||
staticFS = archiver.ArchiveFS{
|
||||
Stream: io.NewSectionReader(strings.NewReader(staticZip), 0, int64(len(staticZip))),
|
||||
Format: archiver.Zip{},
|
||||
}
|
||||
staticFS = bootstrap.NewFS(staticZip)
|
||||
bootstrap.Init(confPath, staticFS)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user