删除dump.rdb,增加redis.conf文件

This commit is contained in:
jingrow 2025-09-19 14:39:24 +08:00
parent 1f28569df5
commit 0d300d950f
5 changed files with 32 additions and 2 deletions

5
.gitignore vendored
View File

@ -6,6 +6,11 @@
*.swp
*.egg-info
dist/
# Redis 数据文件
dump.rdb
*.rdb
redis.conf.bak
# Jflow 前端
node_modules
frontend/dist/

BIN
dump.rdb

Binary file not shown.

View File

@ -5,7 +5,7 @@
"scripts": {
"dev": "./start-dev.sh",
"dev:simple": "concurrently \"npm run redis\" \"npm run worker\" \"npm run frontend\" \"npm run backend\"",
"redis": "redis-server --port 6379 --daemonize yes || echo 'Redis already running or not installed'",
"redis": "redis-server ./redis.conf || echo 'Redis already running or not installed'",
"worker": "cd backend && dramatiq app.services.queue --processes 1 --threads 1",
"frontend": "cd frontend && npm run dev",
"backend": "cd backend && python3 run.py",

25
redis.conf Normal file
View File

@ -0,0 +1,25 @@
# Jflow Redis 配置文件
# 禁用持久化,因为只存储临时任务队列数据
# 基本配置
port 6379
daemonize yes
bind 127.0.0.1
# 禁用RDB持久化
save ""
# 禁用AOF持久化
appendonly no
# 内存配置
maxmemory 256mb
maxmemory-policy allkeys-lru
# 日志配置
loglevel notice
logfile ""
# 其他配置
tcp-keepalive 300
timeout 0

View File

@ -21,7 +21,7 @@ start_redis() {
echo "🔄 Starting Redis..."
if command -v redis-server > /dev/null 2>&1; then
# 尝试启动 Redis
redis-server --port 6379 --daemonize yes 2>/dev/null || {
redis-server ./redis.conf 2>/dev/null || {
echo "⚠️ Redis server start failed, trying alternative method..."
# 如果失败,尝试其他方式
if command -v brew > /dev/null 2>&1; then