Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wsmonitor_sql
Overview
Overview
Details
Activity
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
宋鹏博
wsmonitor_sql
Commits
f1eb17cf
Commit
f1eb17cf
authored
Dec 03, 2025
by
宋鹏博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改监控阈值
parent
391b6878
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
cutils.py
common/cutils.py
+14
-4
No files found.
common/cutils.py
View file @
f1eb17cf
...
@@ -45,12 +45,19 @@ def mk_error_message(error_editor, error_answer, message_id, url=wechaturl):
...
@@ -45,12 +45,19 @@ def mk_error_message(error_editor, error_answer, message_id, url=wechaturl):
requests
.
post
(
url
,
json
=
data
)
requests
.
post
(
url
,
json
=
data
)
def
task_count
(
semantics_task_count
,
ideology_task_count
,
validate_logic_task_count
,
knowledge_task_count
,
dochub_task_count
,
dochub_file_process_over10minutes_count
,
def
task_count
(
semantics_task_count
,
ideology_task_count
,
validate_logic_task_count
,
knowledge_task_count
,
dochub_task_count
,
dochub_file_process_over10minutes_count
,
english_precedent_task
,
url
=
wechaturl
):
url
=
wechaturl
):
data
=
{
data
=
{
"msgtype"
:
"markdown"
,
"msgtype"
:
"markdown"
,
"markdown"
:
{
"markdown"
:
{
"content"
:
f
"审校任务排队情况<font color=
\"
warning
\"
>异常</font>,请相关同事注意。
\n
>语义任务:<font color=
\"
comment
\"
>{semantics_task_count}</font>
\n
内容风险任务:<font color=
\"
comment
\"
>{ideology_task_count}</font>
\n
逻辑检查任务:<font color=
\"
comment
\"
>{validate_logic_task_count}</font>
\n
知识性差错任务:<font color=
\"
comment
\"
>{knowledge_task_count}</font>
\n
文档解析批注任务:<font color=
\"
comment
\"
>{dochub_task_count}</font>
\n
文档解析超过10分钟的文件数:<font color=
\"
comment
\"
>{dochub_file_process_over10minutes_count}</font> "
"content"
:
f
"审校任务排队情况<font color=
\"
warning
\"
>异常</font>,请相关同事注意。"
f
"
\n
>语义任务:<font color=
\"
comment
\"
>{semantics_task_count}</font>"
f
"
\n
内容风险任务:<font color=
\"
comment
\"
>{ideology_task_count}</font>"
f
"
\n
逻辑检查任务:<font color=
\"
comment
\"
>{validate_logic_task_count}</font>"
f
"
\n
知识性差错任务:<font color=
\"
comment
\"
>{knowledge_task_count}</font>"
f
"
\n
文档解析批注任务:<font color=
\"
comment
\"
>{dochub_task_count}</font>"
f
"
\n
文档解析超过10分钟的文件数:<font color=
\"
comment
\"
>{dochub_file_process_over10minutes_count}</font> "
f
"
\n
>英语任务:<font color=
\"
comment
\"
>{english_precedent_task}</font> "
}
}
}
}
requests
.
post
(
url
,
json
=
data
)
requests
.
post
(
url
,
json
=
data
)
...
@@ -77,6 +84,9 @@ def aireview_task():
...
@@ -77,6 +84,9 @@ def aireview_task():
"select count(*) from aireview.semantics_task where create_time >date(now()) and status = 0;"
)
"select count(*) from aireview.semantics_task where create_time >date(now()) and status = 0;"
)
ideology_task_count
=
DButils_aireview
()
.
select_sql
(
"select count(*) from aireview.ideology_task where "
ideology_task_count
=
DButils_aireview
()
.
select_sql
(
"select count(*) from aireview.ideology_task where "
"create_time >date(now()) and status = 0;"
)
"create_time >date(now()) and status = 0;"
)
# 英语任务
english_precedent_task
=
DButils_aireview
()
.
select_sql
(
"select count(*) from aireview.english_precedent_task ept where create_time >CURDATE() and status =0;"
)
validate_logic_task_count
=
DButils_aireview
()
.
select_sql
(
validate_logic_task_count
=
DButils_aireview
()
.
select_sql
(
"select count(*) from aireview.validate_logic_task where create_time >date(now()) and status =0;"
)
"select count(*) from aireview.validate_logic_task where create_time >date(now()) and status =0;"
)
...
@@ -86,6 +96,6 @@ def aireview_task():
...
@@ -86,6 +96,6 @@ def aireview_task():
"select count(*) from document_record where status in (0,1) and create_time >=CURDATE();"
)
"select count(*) from document_record where status in (0,1) and create_time >=CURDATE();"
)
dochub_file_process_over10minutes_count
=
DButils_dochub
()
.
select_sql
(
dochub_file_process_over10minutes_count
=
DButils_dochub
()
.
select_sql
(
"SELECT COUNT(*) FROM document_record WHERE status IN (1) AND create_time >= CURDATE() AND TIMESTAMPDIFF(MINUTE, create_time, update_time) > 30;"
)
"SELECT COUNT(*) FROM document_record WHERE status IN (1) AND create_time >= CURDATE() AND TIMESTAMPDIFF(MINUTE, create_time, update_time) > 30;"
)
if
semantics_task_count
[
0
][
0
]
>
60000
or
ideology_task_count
[
0
][
0
]
>
20000
or
validate_logic_task_count
[
0
][
0
]
>
20000
or
knowledge_task_count
[
0
][
0
]
>
20000
or
dochub_task_count
[
0
][
0
]
>
500
or
dochub_file_process_over10minutes_count
[
0
][
0
]
>
0
:
if
semantics_task_count
[
0
][
0
]
>
60000
or
ideology_task_count
[
0
][
0
]
>
20000
or
validate_logic_task_count
[
0
][
0
]
>
20000
or
knowledge_task_count
[
0
][
0
]
>
20000
or
dochub_task_count
[
0
][
0
]
>
500
or
dochub_file_process_over10minutes_count
[
0
][
0
]
>
0
or
english_precedent_task
[
0
][
0
]
>
0
:
task_count
(
semantics_task_count
[
0
][
0
],
ideology_task_count
[
0
][
0
],
validate_logic_task_count
[
0
][
0
],
knowledge_task_count
[
0
][
0
],
dochub_task_count
[
0
][
0
],
dochub_file_process_over10minutes_count
[
0
][
0
],
url
=
aireview_task_url
)
task_count
(
semantics_task_count
[
0
][
0
],
ideology_task_count
[
0
][
0
],
validate_logic_task_count
[
0
][
0
],
knowledge_task_count
[
0
][
0
],
dochub_task_count
[
0
][
0
],
dochub_file_process_over10minutes_count
[
0
][
0
],
english_precedent_task
[
0
][
0
],
url
=
aireview_task_url
)
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