Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Workers
Base Worker
Merge requests
!90
Change TASK_ID to PONOS_TASK
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Change TASK_ID to PONOS_TASK
fix-task-id
into
master
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Eva Bardou
requested to merge
fix-task-id
into
master
3 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
7d5ad71e
1 commit,
3 years ago
2 files
+
5
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
arkindex_worker/worker/base.py
+
3
−
5
Options
@@ -136,16 +136,15 @@ class BaseWorker(object):
if
self
.
args
.
database
is
not
None
:
self
.
use_cache
=
True
task_id
=
os
.
environ
.
get
(
"
PONOS_TASK
"
)
if
self
.
use_cache
is
True
:
if
self
.
args
.
database
is
not
None
:
assert
os
.
path
.
isfile
(
self
.
args
.
database
),
f
"
Database in
{
self
.
args
.
database
}
does not exist
"
self
.
cache_path
=
self
.
args
.
database
elif
os
.
environ
.
get
(
"
TASK_ID
"
):
cache_dir
=
os
.
path
.
join
(
os
.
environ
.
get
(
"
PONOS_DATA
"
,
"
/data
"
),
os
.
environ
.
get
(
"
TASK_ID
"
)
)
elif
task_id
:
cache_dir
=
os
.
path
.
join
(
os
.
environ
.
get
(
"
PONOS_DATA
"
,
"
/data
"
),
task_id
)
assert
os
.
path
.
isdir
(
cache_dir
),
f
"
Missing task cache in
{
cache_dir
}
"
self
.
cache_path
=
os
.
path
.
join
(
cache_dir
,
"
db.sqlite
"
)
else
:
@@ -157,7 +156,6 @@ class BaseWorker(object):
logger
.
debug
(
"
Cache is disabled
"
)
# Merging parents caches (if there are any) in the current task local cache, unless the database got overridden
task_id
=
os
.
environ
.
get
(
"
TASK_ID
"
)
if
self
.
use_cache
and
self
.
args
.
database
is
None
and
task_id
is
not
None
:
task
=
self
.
request
(
"
RetrieveTaskFromAgent
"
,
id
=
task_id
)
merge_parents_cache
(
Loading