Update repo URL, Redis client key, and add environment variable support
Co-authored-by: 20250410303 <20250410303@stu.fosu.edu.cn>pull/6/head
parent
672a386d2c
commit
7f73c00e0a
File diff suppressed because one or more lines are too long
|
@ -35,7 +35,10 @@ function VersionDisplay() {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
window.open('https://github.com/senshinya/MoonTV', '_blank')
|
window.open(
|
||||||
|
process.env.NEXT_PUBLIC_REPO_URL || 'https://github.com/katelya77/KatelyaTV',
|
||||||
|
'_blank'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
className='absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400 transition-colors cursor-pointer'
|
className='absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400 transition-colors cursor-pointer'
|
||||||
>
|
>
|
||||||
|
|
|
@ -287,8 +287,9 @@ export class RedisStorage implements IStorage {
|
||||||
|
|
||||||
// 单例 Redis 客户端
|
// 单例 Redis 客户端
|
||||||
function getRedisClient(): RedisClientType {
|
function getRedisClient(): RedisClientType {
|
||||||
const globalKey = Symbol.for('__MOONTV_REDIS_CLIENT__');
|
const legacyKey = Symbol.for('__MOONTV_REDIS_CLIENT__');
|
||||||
let client: RedisClientType | undefined = (global as any)[globalKey];
|
const globalKey = Symbol.for('__KATELYATV_REDIS_CLIENT__');
|
||||||
|
let client: RedisClientType | undefined = (global as any)[globalKey] || (global as any)[legacyKey];
|
||||||
|
|
||||||
if (!client) {
|
if (!client) {
|
||||||
const url = process.env.REDIS_URL;
|
const url = process.env.REDIS_URL;
|
||||||
|
@ -349,6 +350,8 @@ function getRedisClient(): RedisClientType {
|
||||||
connectWithRetry();
|
connectWithRetry();
|
||||||
|
|
||||||
(global as any)[globalKey] = client;
|
(global as any)[globalKey] = client;
|
||||||
|
// 同步旧键,保持兼容
|
||||||
|
(global as any)[legacyKey] = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
|
|
Loading…
Reference in New Issue