Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
altlinux-packages-bot
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Unitsaev
altlinux-packages-bot
Commits
25aeddb6
Verified
Commit
25aeddb6
authored
Apr 04, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
help: add taskoteka status and service ping to /altrepo_info
parent
d1ebed32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
help.py
src/handlers/help.py
+29
-4
No files found.
src/handlers/help.py
View file @
25aeddb6
import
time
import
asyncio
from
telegrinder
import
Dispatch
,
Message
from
telegrinder.rules
import
Command
from
telegrinder.tools.formatting
import
HTMLFormatter
,
link
...
...
@@ -12,7 +15,22 @@ dp = Dispatch()
@dp.message
(
Command
(
"altrepo_info"
))
async
def
info_handler
(
m
:
Message
)
->
None
:
api_data
=
await
altrepo
.
api
.
version
()
async
def
ping_api
():
start
=
time
.
monotonic
()
data
=
await
altrepo
.
api
.
version
()
ms
=
int
((
time
.
monotonic
()
-
start
)
*
1000
)
return
data
,
ms
async
def
ping_taskoteka
():
start
=
time
.
monotonic
()
data
=
await
altrepo
.
taskoteka
.
health
()
ms
=
int
((
time
.
monotonic
()
-
start
)
*
1000
)
return
data
,
ms
(
api_data
,
api_ping
),
(
taskoteka_data
,
taskoteka_ping
)
=
await
asyncio
.
gather
(
ping_api
(),
ping_taskoteka
()
)
repos_formatted
=
"
\n
"
.
join
(
f
" - {HTMLFormatter(link(url, text=name))}"
for
name
,
url
in
bot_repositories
...
...
@@ -26,13 +44,20 @@ async def info_handler(m: Message) -> None:
f
"{_bold("
ALTRepo
API
:
")}
\n
"
f
" Актуальная версия: {api_data.version}
\n
"
f
" Поддерживаемая ботом: {altrepo.api.BASE_API_VERSION}
\n\n
"
f
" Поддерживаемая ботом: {altrepo.api.BASE_API_VERSION}
\n
"
f
" Пинг: {api_ping}ms
\n\n
"
f
"{_bold("
Taskoteka
:
")}
\n
"
f
" Статус: {taskoteka_data.status}
\n
"
f
" Активных задач: {taskoteka_data.active_tasks}
\n
"
f
" Всего задач: {taskoteka_data.total_tasks}
\n
"
f
" Пинг: {taskoteka_ping}ms
\n\n
"
f
"{_bold("
ALTRepo
Bot
DB
:
")}
\n
"
f
"{_bold("
Bot
DB
:
")}
\n
"
f
" Сопровождающих в базе: {DB.maintainer.count()}
\n
"
f
" Пакетов переведено: {DB.package.count()}
\n\n
"
f
"{_bold("
ALTRepo
Bot
AppStream
Data
:
")}
\n
"
f
"{_bold("
Bot
AppStream
Data
:
")}
\n
"
f
" Sisyphus: {altrepo.appstream.data.get_current_version("
sisyphus
")}
\n
"
f
" P11: {altrepo.appstream.data.get_current_version("
p11
")}
\n\n
"
...
...
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