Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pypelines
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
HaissLab
Data Management
Pypelines
Commits
18f7e400
Commit
18f7e400
authored
1 year ago
by
Timothe Jost
Browse files
Options
Downloads
Patches
Plain Diff
forgot to update refresh times
parent
89d7c261
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#127759
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pypelines/__init__.py
+1
-1
1 addition, 1 deletion
src/pypelines/__init__.py
src/pypelines/celery_tasks.py
+6
-3
6 additions, 3 deletions
src/pypelines/celery_tasks.py
with
7 additions
and
4 deletions
src/pypelines/__init__.py
+
1
−
1
View file @
18f7e400
__version__
=
"
0.0.4
6
"
__version__
=
"
0.0.4
7
"
from
.
import
loggs
from
.
import
loggs
from
.pipes
import
*
from
.pipes
import
*
...
...
This diff is collapsed.
Click to expand it.
src/pypelines/celery_tasks.py
+
6
−
3
View file @
18f7e400
...
@@ -401,14 +401,16 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
...
@@ -401,14 +401,16 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
auto_refresh_time
=
timedelta
(
0
,
(
2
0
*
1
))
# a full day (24 hours of 3600 seconds)
auto_refresh_time
=
timedelta
(
0
,
(
360
0
*
24
))
# a full day (24 hours of 3600 seconds)
failed_refresh_retry_time
=
timedelta
(
0
,
(
3
0
*
1
))
# try to refresh after
an hour
failed_refresh_retry_time
=
timedelta
(
0
,
(
6
0
*
5
))
# try to refresh after
5 minutes
app_task_data
=
getattr
(
self
,
"
task_data
"
,
None
)
app_task_data
=
getattr
(
self
,
"
task_data
"
,
None
)
if
app_task_data
is
None
:
if
app_task_data
is
None
:
try
:
try
:
task_data
=
self
.
tasks
[
f
"
{
app_name
}
.tasks_infos
"
].
delay
(
app_name
).
get
(
timeout
=
2
)
task_data
=
self
.
tasks
[
f
"
{
app_name
}
.tasks_infos
"
].
delay
(
app_name
).
get
(
timeout
=
10
)
# we set timeout to 10 sec if the task data doesn't exist.
# It's long to wait for a webpage to load, but sometimes the workers take time to come out of sleep
app_task_data
=
{
"
task_data
"
:
task_data
,
"
refresh_time
"
:
datetime
.
now
()
+
auto_refresh_time
}
app_task_data
=
{
"
task_data
"
:
task_data
,
"
refresh_time
"
:
datetime
.
now
()
+
auto_refresh_time
}
setattr
(
self
,
"
task_data
"
,
app_task_data
)
setattr
(
self
,
"
task_data
"
,
app_task_data
)
logger
.
warning
(
"
Got tasks data for the first time since django server relaunched
"
)
logger
.
warning
(
"
Got tasks data for the first time since django server relaunched
"
)
...
@@ -424,6 +426,7 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
...
@@ -424,6 +426,7 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
if
refresh
:
if
refresh
:
try
:
try
:
task_data
=
self
.
tasks
[
f
"
{
app_name
}
.tasks_infos
"
].
delay
(
app_name
).
get
(
timeout
=
2
)
task_data
=
self
.
tasks
[
f
"
{
app_name
}
.tasks_infos
"
].
delay
(
app_name
).
get
(
timeout
=
2
)
# if the data needs to be refreshed, we don't wait for as long as for a first get of infos.
app_task_data
=
{
"
task_data
"
:
task_data
,
"
refresh_time
"
:
datetime
.
now
()
+
auto_refresh_time
}
app_task_data
=
{
"
task_data
"
:
task_data
,
"
refresh_time
"
:
datetime
.
now
()
+
auto_refresh_time
}
logger
.
warning
(
"
Refreshed celery tasks data sucessfully
"
)
logger
.
warning
(
"
Refreshed celery tasks data sucessfully
"
)
except
Exception
as
e
:
except
Exception
as
e
:
...
...
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