From 51f19470bc12c52fc0be4869fa5796d2b6c0e092 Mon Sep 17 00:00:00 2001 From: JustSong Date: Tue, 27 Jun 2023 23:34:23 +0800 Subject: [PATCH 1/2] fix: fix wrong env var name --- README.en.md | 2 +- README.md | 2 +- common/constants.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.en.md b/README.en.md index 51cfb5ba..f98db2e7 100644 --- a/README.en.md +++ b/README.en.md @@ -240,7 +240,7 @@ If the channel ID is not provided, load balancing will be used to distribute the + Example: `CHANNEL_UPDATE_FREQUENCY=1440` 8. `CHANNEL_TEST_FREQUENCY`: When set, it periodically tests the channels, with the unit in minutes. If not set, no test will happen. + Example: `CHANNEL_TEST_FREQUENCY=1440` -9. `REQUEST_INTERVAL`: The time interval (in seconds) between requests when updating channel balances and testing channel availability. Default is no interval. +9. `POLLING_INTERVAL`: The time interval (in seconds) between requests when updating channel balances and testing channel availability. Default is no interval. + Example: `POLLING_INTERVAL=5` ### Command Line Parameters diff --git a/README.md b/README.md index f4712561..6d2da58b 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,7 @@ graph LR + 例子:`CHANNEL_UPDATE_FREQUENCY=1440` 8. `CHANNEL_TEST_FREQUENCY`:设置之后将定期检查渠道,单位为分钟,未设置则不进行检查。 + 例子:`CHANNEL_TEST_FREQUENCY=1440` -9. `REQUEST_INTERVAL`:批量更新渠道余额以及测试可用性时的请求间隔,单位为秒,默认无间隔。 +9. `POLLING_INTERVAL`:批量更新渠道余额以及测试可用性时的请求间隔,单位为秒,默认无间隔。 + 例子:`POLLING_INTERVAL=5` ### 命令行参数 diff --git a/common/constants.go b/common/constants.go index 04502f28..c345c620 100644 --- a/common/constants.go +++ b/common/constants.go @@ -72,7 +72,7 @@ var RootUserEmail = "" var IsMasterNode = os.Getenv("NODE_TYPE") != "slave" -var requestInterval, _ = strconv.Atoi(os.Getenv("REQUEST_INTERVAL")) +var requestInterval, _ = strconv.Atoi(os.Getenv("POLLING_INTERVAL")) var RequestInterval = time.Duration(requestInterval) * time.Second const ( From 05b0e7783924036ee23c1a54c2bff645314777ff Mon Sep 17 00:00:00 2001 From: JustSong Date: Tue, 27 Jun 2023 23:36:12 +0800 Subject: [PATCH 2/2] docs: update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d2da58b..14c8e0bf 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ graph LR + 例子:`SESSION_SECRET=random_string` 3. `SQL_DSN`:设置之后将使用指定数据库而非 SQLite,请使用 MySQL 8.0 版本。 + 例子:`SQL_DSN=root:123456@tcp(localhost:3306)/oneapi` -4. `FRONTEND_BASE_URL`:设置之后将使用指定的前端地址,而非后端地址。 +4. `FRONTEND_BASE_URL`:设置之后将使用指定的前端地址,而非后端地址,仅限从服务器设置。 + 例子:`FRONTEND_BASE_URL=https://openai.justsong.cn` 5. `SYNC_FREQUENCY`:设置之后将定期与数据库同步配置,单位为秒,未设置则不进行同步。 + 例子:`SYNC_FREQUENCY=60`