提交 8ad77027 编写于 作者: H HFO4

Fix: relative path for SQLite file

上级 45b54b34
......@@ -30,7 +30,7 @@ func Init() {
} else {
if conf.DatabaseConfig.Type == "UNSET" {
// 未指定数据库时,使用SQLite
db, err = gorm.Open("sqlite3", "cloudreve.db")
db, err = gorm.Open("sqlite3", util.RelativePath("cloudreve.db"))
} else {
db, err = gorm.Open(conf.DatabaseConfig.Type, fmt.Sprintf("%s:%s@(%s)/%s?charset=utf8&parseTime=True&loc=Local",
conf.DatabaseConfig.User,
......
......@@ -144,8 +144,6 @@ Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; verti
{Name: "home_view_method", Value: "icon", Type: "view"},
{Name: "share_view_method", Value: "list", Type: "view"},
{Name: "cron_garbage_collect", Value: "@hourly", Type: "cron"},
{Name: "cron_notify_user", Value: "@hourly", Type: "cron"},
{Name: "cron_ban_user", Value: "@hourly", Type: "cron"},
{Name: "authn_enabled", Value: "0", Type: "authn"},
{Name: "captcha_height", Value: "60", Type: "captcha"},
{Name: "captcha_width", Value: "240", Type: "captcha"},
......
......@@ -21,7 +21,7 @@ func Reload() {
func Init() {
util.Log().Info("初始化定时任务...")
// 读取cron日程设置
options := model.GetSettingByNames("cron_garbage_collect", "cron_notify_user", "cron_ban_user")
options := model.GetSettingByNames("cron_garbage_collect")
Cron := cron.New()
for k, v := range options {
var handler func()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册