Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Matrix
Commits
92224d6d
Verified
Commit
92224d6d
authored
2 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Sync rooms in separate tasks
parent
0f47c6a7
No related branches found
No related tags found
1 merge request
!7
Resolve "Add periodic task for syncing rooms"
Pipeline
#72892
canceled
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/apps/matrix/model_extensions.py
+0
-1
0 additions, 1 deletion
aleksis/apps/matrix/model_extensions.py
aleksis/apps/matrix/signals.py
+0
-3
0 additions, 3 deletions
aleksis/apps/matrix/signals.py
aleksis/apps/matrix/tasks.py
+3
-1
3 additions, 1 deletion
aleksis/apps/matrix/tasks.py
with
3 additions
and
5 deletions
aleksis/apps/matrix/model_extensions.py
+
0
−
1
View file @
92224d6d
...
...
@@ -22,7 +22,6 @@ def provision_in_matrix(self, sync: bool = False) -> Union[MatrixRoom, AsyncResu
def
_provision_in_matrix
(
self
)
->
MatrixRoom
:
"""
Create and sync a room for this group in Matrix.
"""
room
=
MatrixRoom
.
from_group
(
self
)
room
.
sync
()
return
room
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/matrix/signals.py
+
0
−
3
View file @
92224d6d
...
...
@@ -8,9 +8,6 @@ from .tasks import sync_room
def
post_save_matrix_signal
(
sender
,
instance
,
created
,
**
kwargs
):
"""
Sync Matrix room after changing a group/Matrix room/Matrix profile.
"""
if
created
:
return
rooms
=
[]
if
isinstance
(
instance
,
Group
):
rooms
=
MatrixRoom
.
objects
.
filter
(
group
=
instance
)
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/matrix/tasks.py
+
3
−
1
View file @
92224d6d
from
datetime
import
timedelta
from
typing
import
Sequence
from
celery.task.sets
import
TaskSet
from
aleksis.apps.matrix.models
import
MatrixRoom
from
aleksis.core.celery
import
app
from
aleksis.core.models
import
Group
...
...
@@ -33,4 +35,4 @@ def sync_rooms():
"""
Synchronise all Matrix rooms.
"""
rooms
=
MatrixRoom
.
objects
.
all
()
for
room
in
rooms
:
room
.
sync
(
)
sync_room
.
delay
(
room
.
pk
)
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