Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rybička
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Rybička
Commits
7d46bda9
Commit
7d46bda9
authored
1 year ago
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
don't import model before apps ready
parent
e4e61e06
No related branches found
No related tags found
1 merge request
!9
Release
Pipeline
#15160
passed
1 year ago
Stage: build
Stage: test_deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
timer/consumers.py
+2
-2
2 additions, 2 deletions
timer/consumers.py
with
2 additions
and
2 deletions
timer/consumers.py
+
2
−
2
View file @
7d46bda9
...
@@ -8,8 +8,6 @@ from timeit import default_timer
...
@@ -8,8 +8,6 @@ from timeit import default_timer
from
asgiref.sync
import
sync_to_async
from
asgiref.sync
import
sync_to_async
from
channels.generic.websocket
import
AsyncWebsocketConsumer
from
channels.generic.websocket
import
AsyncWebsocketConsumer
from
.models
import
OngoingTimer
running_timer_threads
=
[]
running_timer_threads
=
[]
...
@@ -71,6 +69,8 @@ def tick_timer(timer, iteration: int, total_seconds: int) -> None:
...
@@ -71,6 +69,8 @@ def tick_timer(timer, iteration: int, total_seconds: int) -> None:
class
TimerConsumer
(
AsyncWebsocketConsumer
):
class
TimerConsumer
(
AsyncWebsocketConsumer
):
async
def
connect
(
self
)
->
None
:
async
def
connect
(
self
)
->
None
:
from
.models
import
OngoingTimer
timer_id
=
self
.
scope
[
"
url_route
"
][
"
kwargs
"
][
"
id
"
]
timer_id
=
self
.
scope
[
"
url_route
"
][
"
kwargs
"
][
"
id
"
]
timer
=
await
sync_to_async
(
OngoingTimer
.
objects
.
filter
(
id
=
timer_id
).
first
)()
timer
=
await
sync_to_async
(
OngoingTimer
.
objects
.
filter
(
id
=
timer_id
).
first
)()
...
...
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