Skip to content

Commit

Permalink
Chore: program will not embed data (#33)
Browse files Browse the repository at this point in the history
* Chore: formatted data.json
* Refactor: program will auto update data after launch
  • Loading branch information
AH-dark authored Sep 12, 2022
1 parent 358d513 commit 7420e0b
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 143 deletions.
25 changes: 0 additions & 25 deletions bootstrap/eject.go

This file was deleted.

9 changes: 4 additions & 5 deletions bootstrap/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ package bootstrap
import (
"github.com/gin-gonic/gin"
"github.com/lezi-wiki/lezi-api/pkg/conf"
"github.com/lezi-wiki/lezi-api/pkg/cron/jobs"
"github.com/lezi-wiki/lezi-api/pkg/log"
"github.com/lezi-wiki/lezi-api/pkg/text"
"github.com/lezi-wiki/lezi-api/services/remote"
)

func Init(dataPath string, data string, confPath string, updateEndpoint string) {
func Init(confPath string, updateEndpoint string) {
printName()

log.Log()

// 初始化配置文件
conf.Init(confPath)

// 初始化数据
text.Init(dataPath, data)

// 设置更新
remote.Endpoint = updateEndpoint

go jobs.UpdateData()

// Debug 关闭时,切换为生产模式
if !conf.SystemConfig.Debug {
gin.SetMode(gin.ReleaseMode)
Expand Down
Loading

0 comments on commit 7420e0b

Please sign in to comment.