移除随机延迟相关配置及 ProxyUrl 默认值,修复拉库通知可能失败

This commit is contained in:
whyour
2023-11-05 01:02:31 +08:00
parent c3a0f58003
commit 4a3ac7dc4b
6 changed files with 15 additions and 29 deletions
+4 -4
View File
@@ -49,7 +49,7 @@ add_cron_api() {
-H "Origin: http://0.0.0.0:5700" \
-H "Referer: http://0.0.0.0:5700/crontab" \
-H "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" \
--data-raw "{\"name\":\"$name\",\"command\":\"$command\",\"schedule\":\"$schedule\",\"sub_id\":$sub_id}" \
--data-raw "{\"name\":\"${name//\"/\\\"}\",\"command\":\"${command//\"/\\\"}\",\"schedule\":\"$schedule\",\"sub_id\":$sub_id}" \
--compressed
)
code=$(echo "$api" | jq -r .code)
@@ -85,7 +85,7 @@ update_cron_api() {
-H "Origin: http://0.0.0.0:5700" \
-H "Referer: http://0.0.0.0:5700/crontab" \
-H "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" \
--data-raw "{\"name\":\"$name\",\"command\":\"$command\",\"schedule\":\"$schedule\",\"id\":\"$id\"}" \
--data-raw "{\"name\":\"${name//\"/\\\"}\",\"command\":\"${command//\"/\\\"}\",\"schedule\":\"$schedule\",\"id\":\"$id\"}" \
--compressed
)
code=$(echo "$api" | jq -r .code)
@@ -117,7 +117,7 @@ update_cron_command_api() {
-H "Origin: http://0.0.0.0:5700" \
-H "Referer: http://0.0.0.0:5700/crontab" \
-H "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" \
--data-raw "{\"command\":\"$command\",\"id\":\"$id\"}" \
--data-raw "{\"command\":\"${command//\"/\\\"}\",\"id\":\"$id\"}" \
--compressed
)
code=$(echo "$api" | jq -r .code)
@@ -196,7 +196,7 @@ notify_api() {
-H "Origin: http://0.0.0.0:5700" \
-H "Referer: http://0.0.0.0:5700/crontab" \
-H "Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" \
--data-raw "{\"title\":\"$title\",\"content\":\"$content\"}" \
--data-raw "{\"title\":\"${title//\"/\\\"}\",\"content\":\"${content//\"/\\\"}\"}" \
--compressed
)
code=$(echo "$api" | jq -r .code)
+1 -5
View File
@@ -70,7 +70,6 @@ import_config() {
ql_base_url=${QlBaseUrl:-"/"}
ql_port=${QlPort:-"5700"}
command_timeout_time=${CommandTimeoutTime:-""}
proxy_url=${ProxyUrl:-""}
file_extensions=${RepoFileExtensions:-"js py"}
current_branch=${QL_BRANCH}
@@ -88,9 +87,6 @@ import_config() {
set_proxy() {
local proxy="$1"
if [[ $proxy ]]; then
proxy_url="$proxy"
fi
if [[ $proxy_url ]]; then
export http_proxy="${proxy_url}"
export https_proxy="${proxy_url}"
fi
@@ -293,7 +289,7 @@ git_clone_scripts() {
set_proxy "$proxy"
git clone --depth=1 $part_cmd $url $dir 2>&1
git clone --depth=1 $part_cmd $url $dir
exit_status=$?
unset_proxy
+1 -1
View File
@@ -138,7 +138,7 @@ update_repo() {
echo -e "\n拉取 ${uniq_path} 成功...\n"
diff_scripts "$repo_path" "$author" "$path" "$blackword" "$dependence" "$extensions" "$autoAddCron" "$autoDelCron"
else
echo -e "\n拉取 ${uniq_path} 失败,请检查网络...\n"
echo -e "\n拉取 ${uniq_path} 失败,请检查日志...\n"
fi
}