diff --git a/models/init.go b/models/init.go index 5976d45..627f187 100644 --- a/models/init.go +++ b/models/init.go @@ -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, diff --git a/models/migration.go b/models/migration.go index 023d666..42db7ad 100644 --- a/models/migration.go +++ b/models/migration.go @@ -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"}, diff --git a/pkg/crontab/init.go b/pkg/crontab/init.go index 72760fc..78f1756 100644 --- a/pkg/crontab/init.go +++ b/pkg/crontab/init.go @@ -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()