Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.web
Commits
71493cf7
Commit
71493cf7
authored
Oct 23, 2017
by
Philip ABBET
Browse files
[backend] Add back the transaction decorators (needed for select_for_update)
parent
2bdb0d35
Changes
1
Show whitespace changes
Inline
Side-by-side
beat/web/backend/helpers.py
View file @
71493cf7
...
...
@@ -26,6 +26,7 @@
###############################################################################
from
django.conf
import
settings
from
django.db
import
transaction
from
django.db.models
import
Count
from
django.db.models
import
Q
...
...
@@ -54,6 +55,7 @@ import beat.core.algorithm
from
beat.core.utils
import
NumpyJSONEncoder
@
transaction
.
atomic
def
schedule_experiment
(
experiment
):
'''Schedules the experiment for execution at the backend
...
...
@@ -133,6 +135,7 @@ def schedule_experiment(experiment):
#----------------------------------------------------------
@
transaction
.
atomic
def
cancel_experiment
(
experiment
):
'''Cancel the execution of the experiment on the backend
...
...
@@ -556,6 +559,7 @@ def retrieve_candidate_splits_for_queue(queue):
#----------------------------------------------------------
@
transaction
.
atomic
def
assign_split_to_worker
(
split
,
worker
):
'''Schedules the split to be executed on a given worker'''
...
...
@@ -572,6 +576,7 @@ def assign_split_to_worker(split, worker):
#----------------------------------------------------------
@
transaction
.
atomic
def
mark_similar_jobs_as_mirror
(
job
):
'''Mark all similar jobs as mirror, and delete their job splits'''
...
...
@@ -898,6 +903,7 @@ def cancel_all_blocks(experiment):
#----------------------------------------------------------
@
transaction
.
atomic
def
update_experiment
(
experiment
):
experiment
=
Experiment
.
objects
.
select_for_update
().
get
(
pk
=
experiment
.
pk
)
...
...
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