Spaces:
Running
Running
github-actions[bot]
Sync from GitHub Viciy2023/Qwen2API-A@b372de2fdb435c7fa78fc69c146257a58c842fba
4289eb1 | const path = require('path') | |
| const resolvePath = (targetPath, fallbackPath) => { | |
| if (targetPath && targetPath.trim()) { | |
| return path.resolve(targetPath) | |
| } | |
| return path.resolve(fallbackPath) | |
| } | |
| const dataDir = resolvePath(process.env.DATA_DIR, path.join(__dirname, '../../data')) | |
| const cacheDir = resolvePath(process.env.CACHE_DIR, path.join(__dirname, '../../caches')) | |
| const logDir = resolvePath(process.env.LOG_DIR, path.join(__dirname, '../../logs')) | |
| module.exports = { | |
| dataDir, | |
| cacheDir, | |
| logDir, | |
| dataFilePath: path.join(dataDir, 'data.json'), | |
| usageStatsFilePath: path.join(dataDir, 'usage-stats.json') | |
| } | |