Fix: relative path for SQLite file

pull/247/head
HFO4 5 years ago
parent 45b54b3455
commit 8ad7702736

@ -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()

Loading…
Cancel
Save