无法通过环境变量配置Rerdis缓存
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 10.8k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
环境信息
- ZFile 版本:
4.4.0 Pro - 涉及存储源:
不涉及 - 部署方式:
Docker - 操作系统/设备:
MacOS - 浏览器/版本号:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
复现步骤
已通过环境变量配置Redis缓存信息,但Redis未收到任何缓存请求,通过环境变量配置的数据库信息到时可以正常使用
预期结果
能通过环境变量配置Redis,最总取代配置文件
实际结果
Redis缓存未启用
额外信息
app = 'aassdsada'
primary_region = 'nrt'
[env]
SPRING_CONFIG_IMPORT="classpath:application-default.properties"
ZFILE_DEBUG="false"
ZFILE_LOG_PATH="${user.home}/.zfile-v4/logs"
ZFILE_DB_PATH="${user.home}/.zfile-v4/db/zfile"
ZFILE_PREVIEW_TEXT_MAXFILESIZEKB="512"
ZFILE_DBCACHE_ENABLE="true"
SPRING_WEB_RESOURCES_STATIC_LOCATIONS="file:static/"
SERVER_PORT="8080"
SPRING_DATASOURCE_DRIVER_CLASS_NAME="com.mysql.cj.jdbc.Driver"
SPRING_DATASOURCE_URL='jdbc:mysql://sadsadsadsa.ap-northeast-1.prod.aws.tidbcloud.com:4000/test?characterEncoding=utf8&serverTimezone=Asia/Sh
anghai&useSSL=false&allowPublicKeyRetrieval=true&sslMode=REQUIRED'
SPRING_DATASOURCE_USERNAME="assddsasd"
SPRING_DATASOURCE_PASSWORD="assdsa"
SPRING_PROFILES_ACTIVE="prod"
MYBATIS_PLUS_TYPE_HANDLERS_PACKAGE="im.zhaojun.zfile.core.config"
SPRING_DATA_REDIS_HOST="redis-aaaa.ssap-northeast-1-2.ec2.redns.redis-cloud.com"
SPRING_DATA_REDIS_PORT=15687
SPRING_DATA_REDIS_PASSWORD="aass"
SPRING_DATA_REDIS_DATABASE="0"
SPRING_DATA_REDIS_TIMEOUT="5s"
SPRING_DATA_REDIS_LETTUCE_POOL_MAX_ACTIVE="20"
SPRING_DATA_REDIS_LETTUCE_POOL_MAX_IDLE="10"
SPRING_DATA_REDIS_LETTUCE_POOL_MIN_IDLE="5"
[build]
image = "zhaojun1998/zfile-pro:latest"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 1
processes = ['app']
[http_service.http_options.response]
pristine = true
[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 768
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by tracing how the Docker environment variables, especially SPRING_DATA_REDIS_* and SPRING_CONFIG_IMPORT, are loaded alongside application-default.properties, then reproduce the configuration with Docker. Done means Redis is enabled and receives cache requests when configured only through environment variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, redis, spring-boot
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100