Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
M
macos-runtime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭阔
macos-runtime
Commits
f8b12362
Commit
f8b12362
authored
Oct 28, 2026
by
郭阔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(keepalive): 撞墙即邮件告警(6小时节流),提示人工过滑块恢复
parent
6fc2dbb4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
keepalive.sh
bin/keepalive.sh
+20
-0
No files found.
bin/keepalive.sh
View file @
f8b12362
...
...
@@ -34,3 +34,23 @@ export CDP_PROFILE_OVERRIDE="$PROFILE"
export
NH_LOCK_DIR
=
"
$WORK_DIR
/runlocks"
export
NH_KEEPALIVE_STATUS
=
"
${
LOG_DIR
:-
$WORK_DIR
/logs
}
/
${
SITE
}
.keepalive.json"
node
"
$SKILL_DIR
/scripts/keepalive.js"
_rc
=
$?
# 撞墙告警(exit 3):邮件提醒人工过一次滑块;6 小时节流,避免每小时重复轰炸
if
[
"
$_rc
"
=
3
]
&&
[
-x
"
$HERE
/notify-mail.sh"
]
;
then
_alert_ts
=
"
$LOG_DIR
/
${
SITE
}
.wall-alert.ts"
_last
=
"
$(
cat
"
$_alert_ts
"
2>/dev/null
||
echo
0
)
"
_now
=
"
$(
date
+%s
)
"
if
[
$((
_now
-
_last
))
-ge
21600
]
;
then
_conf_dir
=
"
${
CONF_DIR
:-$(
nh_default_conf_dir
"
$WORK_DIR
"
)}
"
_mail_to
=
"
$(
sed
-n
's/^MAIL_TO=//p'
"
$_conf_dir
/default.conf"
2>/dev/null |
head
-1
)
"
if
[
-n
"
$_mail_to
"
]
;
then
printf
'Reuters 反爬墙(DataDome)已触发,自动保温访问无法自愈,采集将持续失败直到人工恢复。\n\n恢复方法(1 分钟):面板 站点登录 → reuters 人工登录,完成一次滑块验证即可。\n\n最近检测:\n%s\n'
\
"
$(
cat
"
$NH_KEEPALIVE_STATUS
"
2>/dev/null
)
"
\
|
"
$HERE
/notify-mail.sh"
"
$_mail_to
"
"[News Harvester] ⚠️ reuters 撞反爬墙,需人工过一次滑块"
\
&&
echo
"
$_now
"
>
"
$_alert_ts
"
\
&&
echo
"keepalive: 已发送撞墙告警邮件(6 小时内不重复)"
fi
fi
fi
exit
"
$_rc
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment