Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-python
Manage
Activity
Members
Plan
Custom issue tracker
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-python
Commits
3ec7463f
Commit
3ec7463f
authored
5 months ago
by
Podosochnyy Maxim
Browse files
Options
Downloads
Patches
Plain Diff
Исправлена работа с операциями в классе ExtensionService
parent
2fbb962b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
perxis-proto
+1
-1
1 addition, 1 deletion
perxis-proto
perxis/extensions/extension_service.py
+15
-3
15 additions, 3 deletions
perxis/extensions/extension_service.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
17 additions
and
5 deletions
perxis-proto
@
f10336dc
Compare
0627c9f8
...
f10336dc
Subproject commit
0627c9f829178bc6de2623a0b6d42964c44de496
Subproject commit
f10336dc4a4f58111c12dd95afec82be18388803
This diff is collapsed.
Click to expand it.
perxis/extensions/extension_service.py
+
15
−
3
View file @
3ec7463f
...
@@ -94,7 +94,7 @@ class ExtensionService(
...
@@ -94,7 +94,7 @@ class ExtensionService(
clients
:
list
[
clients_pb2
.
Client
]
=
[]
clients
:
list
[
clients_pb2
.
Client
]
=
[]
actions
:
list
[
dict
]
=
[]
actions
:
list
[
dict
]
=
[]
__operations
:
dict
[
str
,
OperationMeta
]
=
{}
__operations
:
dict
[
str
,
OperationMeta
]
def
__init__
(
self
,
def
__init__
(
self
,
collections_service
:
collections_pb2_grpc
.
CollectionsStub
,
collections_service
:
collections_pb2_grpc
.
CollectionsStub
,
...
@@ -137,6 +137,8 @@ class ExtensionService(
...
@@ -137,6 +137,8 @@ class ExtensionService(
self
.
roles_service
,
self
.
clients_service
,
self
.
items_service
,
self
.
roles_service
,
self
.
clients_service
,
self
.
items_service
,
)
)
self
.
__operations
=
{}
for
collection
in
self
.
collections
or
[]:
for
collection
in
self
.
collections
or
[]:
self
.
extension_setup
.
add_collection
(
collection
)
self
.
extension_setup
.
add_collection
(
collection
)
...
@@ -153,6 +155,10 @@ class ExtensionService(
...
@@ -153,6 +155,10 @@ class ExtensionService(
async
def
remove_old_operations
():
async
def
remove_old_operations
():
self
.
remove_old_operations
()
self
.
remove_old_operations
()
@property
def
operations
(
self
):
return
self
.
__operations
def
remove_old_operations
(
self
):
def
remove_old_operations
(
self
):
self
.
logger
.
info
(
"
Удаление старых операций
"
)
self
.
logger
.
info
(
"
Удаление старых операций
"
)
...
@@ -234,6 +240,12 @@ class ExtensionService(
...
@@ -234,6 +240,12 @@ class ExtensionService(
description
=
description
description
=
description
)
)
def
mark_operation_as_finished
(
self
,
operation_id
:
str
,
errors
:
list
[
str
]
|
None
=
None
):
if
operation_id
in
self
.
operations
:
self
.
operations
[
operation_id
].
mark_finished
(
errors
)
else
:
self
.
logger
.
error
(
f
"
Операция
{
operation_id
}
не найдена!
"
)
async
def
_Install
(
self
,
operation_id
:
str
,
request
:
extension_service_pb2
.
InstallRequest
,
context
):
async
def
_Install
(
self
,
operation_id
:
str
,
request
:
extension_service_pb2
.
InstallRequest
,
context
):
errors_list
=
await
self
.
extension_setup
.
install
(
errors_list
=
await
self
.
extension_setup
.
install
(
request
.
space_id
,
request
.
env_id
,
request
.
force
request
.
space_id
,
request
.
env_id
,
request
.
force
...
@@ -241,7 +253,7 @@ class ExtensionService(
...
@@ -241,7 +253,7 @@ class ExtensionService(
self
.
result_log
(
"
установки
"
,
operation_id
,
request
,
errors_list
)
self
.
result_log
(
"
установки
"
,
operation_id
,
request
,
errors_list
)
self
.
_
_operation
s
[
operation_id
].
mark_finished
(
errors_list
)
self
.
mark
_operation
_as_finished
(
operation_id
,
errors_list
)
async
def
Install
(
self
,
request
:
extension_service_pb2
.
InstallRequest
,
context
):
async
def
Install
(
self
,
request
:
extension_service_pb2
.
InstallRequest
,
context
):
operation_id
=
generate_operation_id
()
operation_id
=
generate_operation_id
()
...
@@ -265,7 +277,7 @@ class ExtensionService(
...
@@ -265,7 +277,7 @@ class ExtensionService(
self
.
result_log
(
"
удаления
"
,
operation_id
,
request
,
errors_list
)
self
.
result_log
(
"
удаления
"
,
operation_id
,
request
,
errors_list
)
self
.
_
_operation
s
[
operation_id
].
mark_finished
(
errors_list
)
self
.
mark
_operation
_as_finished
(
operation_id
,
errors_list
)
async
def
Uninstall
(
self
,
request
:
extension_service_pb2
.
UninstallRequest
,
context
):
async
def
Uninstall
(
self
,
request
:
extension_service_pb2
.
UninstallRequest
,
context
):
operation_id
=
generate_operation_id
()
operation_id
=
generate_operation_id
()
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
3ec7463f
...
@@ -14,7 +14,7 @@ def load_requirements():
...
@@ -14,7 +14,7 @@ def load_requirements():
setup
(
setup
(
name
=
'
perxis
'
,
name
=
'
perxis
'
,
version
=
'
1.8.
0
'
,
version
=
'
1.8.
1
'
,
description
=
'
Perxis python client
'
,
description
=
'
Perxis python client
'
,
long_description
=
long_description
,
long_description
=
long_description
,
long_description_content_type
=
'
text/markdown
'
,
long_description_content_type
=
'
text/markdown
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment