Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
e481a2e4
Commit
e481a2e4
authored
3 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow some retries on initialize_activity
parent
ba4a32ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1597
Allow some retries on initialize_activity
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/dataimport/tasks.py
+3
-2
3 additions, 2 deletions
arkindex/dataimport/tasks.py
with
3 additions
and
2 deletions
arkindex/dataimport/tasks.py
+
3
−
2
View file @
e481a2e4
...
...
@@ -3,15 +3,16 @@ from typing import Optional
from
django.conf
import
settings
from
django.db
import
transaction
from
django_rq
import
job
from
rq
import
Retry
from
arkindex.dataimport.models
import
ActivityState
,
DataImport
,
WorkerActivity
,
WorkerActivityState
@job
(
'
default
'
,
timeout
=
settings
.
RQ_TIMEOUTS
[
'
initialize_activity
'
])
@job
(
'
default
'
,
timeout
=
settings
.
RQ_TIMEOUTS
[
'
initialize_activity
'
]
,
retry
=
Retry
(
max
=
4
)
)
def
initialize_activity
(
process
:
DataImport
):
"""
List all worker versions used in a process and initialize their activity on processed elements.
Timeout is set to 1 hour
4 retries allowed, for a total of 5 attempts, to try to mitigate some database errors from the large query.
"""
try
:
with
transaction
.
atomic
():
...
...
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