mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 18:26:36 +08:00
feat(log): 解耦用户访问日志存储,支持切换日志主库
用户访问日志可在 ClickHouse、PostgreSQL、SQLite 之间切换。 关闭 ClickHouse 时由主库承接写入与查询;切换任务会冻结写入、复制数据后翻转主库。 启动时校验日志主库与运行配置一致,定期清理按各库保留天数删除过期记录。
This commit is contained in:
@@ -282,6 +282,36 @@ func getSeedConfigsPart2() []model.SystemConfig {
|
||||
Type: configTypeSystem,
|
||||
Description: "文件存储驱动及连接配置(JSON)",
|
||||
},
|
||||
{
|
||||
Key: model.ConfigKeyLogDatabase,
|
||||
Value: "sqlite",
|
||||
Type: configTypeSystem,
|
||||
Description: "当前日志主库",
|
||||
},
|
||||
{
|
||||
Key: model.ConfigKeyLogDBMigration,
|
||||
Value: "",
|
||||
Type: configTypeSystem,
|
||||
Description: "日志库迁移冻结标记",
|
||||
},
|
||||
{
|
||||
Key: model.ConfigKeyLogRetentionDaysPostgres,
|
||||
Value: "30",
|
||||
Type: "business",
|
||||
Description: "PostgreSQL 用户访问日志保留天数",
|
||||
},
|
||||
{
|
||||
Key: model.ConfigKeyLogRetentionDaysSQLite,
|
||||
Value: "30",
|
||||
Type: "business",
|
||||
Description: "SQLite 用户访问日志保留天数",
|
||||
},
|
||||
{
|
||||
Key: model.ConfigKeyLogRetentionDaysClickHouse,
|
||||
Value: "30",
|
||||
Type: "business",
|
||||
Description: "ClickHouse 用户访问日志保留天数",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user